how can i make that a textbox dont show a number or a letter
when someone tries to tipp 6 there will nothing appear can someone show me that ?
How to make a textbox not to show a specified number or letter ?
Started by kresh7, Feb 22 2008 11:08 AM
11 replies to this topic
#1
Posted 22 February 2008 - 11:08 AM
|
|
|
#2
Posted 22 February 2008 - 11:54 AM
well in that case you will have to make that when vbKey6 (or something like that) is pressed text1.text = ""
or something similar. Sorry but I can't show you the code because VB6.0 is not installed.
or something similar. Sorry but I can't show you the code because VB6.0 is not installed.
#3
Posted 23 February 2008 - 10:39 AM
thanks anyway :D i thing you mean using if text1.text = "6" then
text1.text = "" end if
i thing that should works but i thought there must be an easier way
text1.text = "" end if
i thing that should works but i thought there must be an easier way
#4
Posted 23 February 2008 - 03:09 PM
If text1.text = "6" then text1.text = "" End If
That's the best way to do it..
#5
Posted 24 February 2008 - 11:47 AM
No i did not mean that, i mean you should monitor all buttons pressed and if 6 is pressed while you have a focus on text1 then text1.text=""
hope you understood better.
hope you understood better.
#6
Posted 25 February 2008 - 10:28 AM
TcM said:
No i did not mean that, i mean you should monitor all buttons pressed and if 6 is pressed while you have a focus on text1 then text1.text=""
hope you understood better.
hope you understood better.
i never worked with focus before how is an example code ?
#7
Posted 26 February 2008 - 06:21 AM
Well I don't have VB 6.0 installed but it's either something like text1.focus or use the procedure text1_onfocus() maybe something like that....
#8
Posted 26 February 2008 - 09:30 AM
i will try it i hope i do it right
#9
Posted 26 February 2008 - 06:22 PM
TcM said:
No i did not mean that, i mean you should monitor all buttons pressed and if 6 is pressed while you have a focus on text1 then text1.text=""
hope you understood better.
hope you understood better.
how about ... if the field is called text1...
private sub text1_KeyPress (KeyAscii as integer) if (KeyAscii = 65) then text1 = "" end subWhen typing in text 1, if you type in "A", it blanks the field
so you could do something like ..
dim mypwd as string private sub text1_KeyPress (KeyAscii as integer) mypwd = mypwd + chr(keyascii) text1 = "" end sub
#10
Posted 27 February 2008 - 04:52 AM
I did not try it, but it seems like it would work.
Nice +rep given.
But please another time use code tags instead of color.
Thanks
Nice +rep given.
But please another time use code tags instead of color.
Thanks
#11
Posted 27 February 2008 - 09:31 AM
badkarma said:
how about ... if the field is called text1...
so you could do something like ..
private sub text1_KeyPress (KeyAscii as integer) if (KeyAscii = 65) then text1 = "" end subWhen typing in text 1, if you type in "A", it blanks the field
so you could do something like ..
dim mypwd as string private sub text1_KeyPress (KeyAscii as integer) mypwd = mypwd + chr(keyascii) text1 = "" end sub
Thx a lot my frend for this
#12
Posted 28 February 2008 - 09:04 AM
It dosent work i dont know why :S


Sign In
Create Account


Back to top









