Problem with ToTitleCase method

  • Thread starter Thread starter Robert Johnson
  • Start date Start date
R

Robert Johnson

Hi all. When I use this code I get the following error: "ToTitleCase is not
a member of frmPropertyMasterMaint."

I have placed both imports as reccomended by the help docs in the
declarations so I don't see why the problem.

Robert
Imports System

Imports System.Globalization


txtFirstName.Text = Me.ToTitleCase(FN)
 
Robert Johnson said:
Hi all. When I use this code I get the following error: "ToTitleCase
is not a member of frmPropertyMasterMaint."

I have placed both imports as reccomended by the help docs in the
declarations so I don't see why the problem.

Robert
Imports System

Imports System.Globalization


txtFirstName.Text = Me.ToTitleCase(FN)


Why "Me."? In the other thread, David wrote how to use the function.


Armin
 
Robert Johnson said:
Hi all. When I use this code I get the following error: "ToTitleCase is
not a member of frmPropertyMasterMaint."

I have placed both imports as reccomended by the help docs in the
declarations so I don't see why the problem.

Robert
Imports System

Imports System.Globalization


txtFirstName.Text = Me.ToTitleCase(FN)

Had not seen this function (which I sure could have used several times
before) so I did some testing.

Ok,
Dim g As New System.Globalization.TextInfo
results in an error indicating that TextInfo has no constructors

error BC30251: Type 'System.Globalization.TextInfo' has no constructors.

Dim g As New System.Globalization.TextInfo


Well now how can that be. If an object has no constuctors then how is it
created? This class has no shared members so far as the Object browser is
concerned and has a default constructor.

To say this makes no sense is an understatement.

Very confusing

Lloyd Sheen
 
Me is the objet instance in which you are that is the form if you code is in
a form class (Me doesn't relate to namespaces as you perhaps seems to
thought).
 
Ah, I see. I didn't understand what he meant. Got it now.

txtFirstName.Text =
System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(FN)

Thanks for the heads up.

Robert
 
Lloyd this is how you use it:

Regards,

Robert


txtFirstName.Text =
System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(FN)
 
Patrice, you are correct. I'm still trying to get my head around .NET. I
come from another language so this is totally new for me.

Thanks for your reply

Robert
 
Robert Johnson said:
Lloyd this is how you use it:

Regards,

Robert


txtFirstName.Text =
System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(FN)

Thanks
Lloyd
 
Back
Top