| View previous topic :: View next topic |
| Author |
Message |
Box Grandmaster Cheater
Reputation: 0
Joined: 16 Oct 2007 Posts: 541
|
Posted: Thu Jun 12, 2008 2:17 pm Post subject: need help very easy!!!!!!!!+rep |
|
|
some one make me a visual basic 6 code for text box so no one can type letters in it only numbers _________________
| zurkei wrote: | | Wow box your a real dick, I can't believe I actually thought that you were telling the truth... |
Fact: no one tells the truth on cheat engine fourms |
|
| Back to top |
|
 |
Golden Wing Grandmaster Cheater
Reputation: 0
Joined: 29 Aug 2007 Posts: 905
|
Posted: Thu Jun 12, 2008 3:59 pm Post subject: Re: need help very easy!!!!!!!!+rep |
|
|
| magic moo wrote: | | some one make me a visual basic 6 code for text box so no one can type letters in it only numbers |
| Code: | If Len(Text1.Text) > 0 And IsNumeric(Text1.Text) Then
result = cint(Text1.Text)
Else
MsgBox "Only Digits!!"
End If |
|
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Thu Jun 12, 2008 4:21 pm Post subject: |
|
|
| how about SEARCH? |
|
| Back to top |
|
 |
Golden Wing Grandmaster Cheater
Reputation: 0
Joined: 29 Aug 2007 Posts: 905
|
Posted: Thu Jun 12, 2008 7:26 pm Post subject: |
|
|
| masterkert3 wrote: | | how about SEARCH? | how about not posting?i already give him the answer |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Jun 13, 2008 10:44 am Post subject: |
|
|
Your code is incorrect for what he wants DemonRobbie. He wants a text box you can only type numbers into. Which you can use the following to achieve:
| Code: | Private Sub Text1_KeyPress(KeyAscii As Integer)
'// Allow Backspaces
If KeyAscii = vbKeyBack Then
Exit Sub
End If
'// Check For Ascii Key Code
If KeyAscii < 48 Or KeyAscii > 57 Then
'// Was a letter...
KeyAscii = 0
End If
End Sub |
_________________
- Retired. |
|
| Back to top |
|
 |
Golden Wing Grandmaster Cheater
Reputation: 0
Joined: 29 Aug 2007 Posts: 905
|
Posted: Fri Jun 13, 2008 11:13 am Post subject: |
|
|
| Wiccaan wrote: | Your code is incorrect for what he wants DemonRobbie. He wants a text box you can only type numbers into. Which you can use the following to achieve:
| Code: | Private Sub Text1_KeyPress(KeyAscii As Integer)
'// Allow Backspaces
If KeyAscii = vbKeyBack Then
Exit Sub
End If
'// Check For Ascii Key Code
If KeyAscii < 48 Or KeyAscii > 57 Then
'// Was a letter...
KeyAscii = 0
End If
End Sub |
|
I am not gonna argue casue your smarter and always win but when i tried my code it worked for me Oo |
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Fri Jun 13, 2008 11:29 am Post subject: |
|
|
| xDemonRobbiex: your code sets a variable to whatever the TextBox's integral is (if parsed) It doesn't prevent the typed characters from appearing in the text box (although you could reset the text, that still wouldn't achieve the desired effect - technically atleast). Wiccaan's snippet sets the character code to null which obviously will render no text, unless the character code is within the numeric c.c. range. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Jun 13, 2008 9:57 pm Post subject: |
|
|
| xDemonRobbiex wrote: | | I am not gonna argue casue your smarter and always win but when i tried my code it worked for me Oo |
Your code, as Estx said, sets a variable to a value which does not do anything to the textbox itself. You set an undefined variable (which will cause an error if using 'Option Explicit') to hold the numeric value of what the textbox holds, but you never do anything with it. _________________
- Retired. |
|
| Back to top |
|
 |
|