How do I use key_down event in my vb.net? I have seen so many codes on google but none of them working I don’t understand where its going wrong
- http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress.aspx#Y600
- http://www.daniweb.com/software-development/vbnet/threads/114278
- http://forums.devshed.com/net-development-87/keypress-allow-only-letters-and-numbers-with-max-lenght-of-528176.html
- http://social.msdn.microsoft.com/Forums/pl-PL/Vsexpressvb/thread/aab1d64c-a9dc-4dd2-8d2f-83a414e9c909
- http://www.bigresource.com/VB-Lock-textbox-so-the-user-only-can-enter-numbers-a8mxDB7ouq.html
- http://forums.devx.com/archive/index.php/t-96951.html
Above are the links I googled and they are many links =I have googled to work on key_down events on vb.net But my god its aint working I dont know what to do.
1) How do I use textbox1_keydown event are there any necessary steps taken before using it ( why its aint workin?)
2) can anyone post a sample of these “a textbox that allows only numbers from user using key_down”
3) I see people using e.keychar but in my vb.net(2008) I dont have that keyword I guess e.keycode must be used is that right? or e.keyvalue?
4) I see e.keycode = keys.A but I need to accept ‘a’ not “A” How do I specify a number or letter with their ascii value ?
Are you not able to use KeyPress for some reason?
This should do what you need. You can find a list of ASCII codes here if you don’t have one already. Take a look at the intellisense for Char. and check out all the useful things you can filter on. You can also specify exact ASCII values by converting them to int.