| View previous topic :: View next topic |
| Author |
Message |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Sun Dec 14, 2008 7:11 pm Post subject: [VB.net] 2 Questions [SOLVED] |
|
|
1. Well, I need some help with my ErrorHandler.
I want to have a textbox with a text in for something, let's say Gamble for example. Now I want my Errorhandler to display an error message if you say something else than Gamble which I already have made. The problem is, how can I make it non-sensitive for caps lock? So it doesn't deliver error messages when typing: GAmble, GAMBLE, gAMBLE ect... No, I don't want to type alot of "Or TextBox6.Text = GAMBLE" and so on -.-
2. I want to make a textbox code where it's supposed to be that you put a letter first and then the value. Example:
'M: 15' for one character and 'L: 15' for another. The value of the variable is 15 and the text L: and M: is just for the differances of the characters. So how can I make it be able to do that? _________________
Last edited by I'm C.H. on Tue Dec 16, 2008 11:03 am; edited 1 time in total |
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Sun Dec 14, 2008 9:52 pm Post subject: |
|
|
?? doesn't make much sense. I could help you if it made sense. _________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Dec 14, 2008 9:58 pm Post subject: |
|
|
1. Look at the String.Compare method, you can set if you want it to be case sensitive or not.
2. I don't really get what you're trying to do |
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Sun Dec 14, 2008 11:06 pm Post subject: |
|
|
to make a string lowercase, you would want... umm.
| Code: |
dim lol as string = "mEOW"
lol = lol.ToLower
or
lol = LCase(lol)
|
i think that's what you want.
for number two, add a keypress event and do
dim check as integer
asc(e.keychar)
if check = 100 then
bla
else
e.handled = true
end if
i guess. _________________
|
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Mon Dec 15, 2008 12:27 am Post subject: |
|
|
Okay, for number one I need an example on it's usage of the words Low, Medium, High and Best.
For the second one, Haven't tested yet but I dunno how it could make M: and L: separate eachother. I also need an example there :/ _________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Dec 15, 2008 2:10 pm Post subject: |
|
|
| CheatingHacker wrote: | Okay, for number one I need an example on it's usage of the words Low, Medium, High and Best.
For the second one, Haven't tested yet but I dunno how it could make M: and L: separate eachother. I also need an example there :/ |
String.Compare(TextBox1.Text, "Low", True);
would do a case independent comparison of the word 'Low'.
low, LoW lOw, whatever will return a match.
http://msdn.microsoft.com/en-us/library/zkcaxw5y.aspx |
|
| Back to top |
|
 |
hacksign23 Master Cheater
Reputation: 0
Joined: 26 Nov 2006 Posts: 404
|
Posted: Mon Dec 15, 2008 7:50 pm Post subject: |
|
|
or...
if TextBox1.Text <> "low" then
MsgBox("ERRORZ!")
exit sub
end if _________________
|
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Dec 16, 2008 5:21 am Post subject: |
|
|
| slovach wrote: | | CheatingHacker wrote: | Okay, for number one I need an example on it's usage of the words Low, Medium, High and Best.
For the second one, Haven't tested yet but I dunno how it could make M: and L: separate eachother. I also need an example there :/ |
String.Compare(TextBox1.Text, "Low", True);
would do a case independent comparison of the word 'Low'.
low, LoW lOw, whatever will return a match.
http://msdn.microsoft.com/en-us/library/zkcaxw5y.aspx |
Okay, Thx but how do I make so that an error message gets displayed if any other words or numbers are used? _________________
|
|
| Back to top |
|
 |
Wintermoot Expert Cheater
Reputation: 0
Joined: 08 Nov 2007 Posts: 198
|
Posted: Tue Dec 16, 2008 5:34 am Post subject: |
|
|
According to a quick glance over MSDN, it goes like:
| Code: |
if String.Compare(TextBox1.Text, "Low", True) = 0 then
//It's true
|
|
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Tue Dec 16, 2008 11:02 am Post subject: |
|
|
Worked! Thx ^^
[SOLVED] _________________
|
|
| Back to top |
|
 |
|