Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable case sensitivity!! vb.net 2005 1

Status
Not open for further replies.

DimMeAsNewbie

Technical User
Mar 17, 2007
20
GB
Does anyone know how i can disable case sensitivity.I want my programme to disregard instances where a user presses a key and if that character is in the corresponding file but in uppercase to display regardless.

Thanks!
 
I'm not sure I follow you, VB.Net 2005 is (in most places atleast) case insensitive. If you are asking about making a process in your code case insensitive, it might help to get a bit of code, but the usual easy way to do it is to set both compared strings to upper case:

Code:
MyVariable = "mY sTRING"
if "My String".ToUpper = MyVariable.ToUpper then msgbox "They match!"

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Thanks Rick,
What's happening is i'm reading a word from file which is randomly selected. The words start with a capital letter then small letters. Eg London, so what is happening is if i type in l instead of L it's not recognising and the same for the small letters. I'm not sure how i can disable this to make it work regardless.

Thanks
 
I'll admit I don't quite follow what you're doing, and Rick's solution works well for your needs. But, I just thought I'd chime in with a possible alternative. If you have a textbox control on a form, you can set that textbox control's "CharacterCasing" property to "Upper"...this forces all text entered to uppercase.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top