Input mask on text box
-
Is there are a way to put an input mask or some type of validation on a text box? I either want to stop anything apart from upper and lowercase letters as they are typing in the box or Load an event on a button press if anything except uppercase and lowercase is in the box. Any ideas? Cheers in advance
-
Is there are a way to put an input mask or some type of validation on a text box? I either want to stop anything apart from upper and lowercase letters as they are typing in the box or Load an event on a button press if anything except uppercase and lowercase is in the box. Any ideas? Cheers in advance
can write code to validate the text input in 'key press' event or 'change event' or 'lost focus' event of text box Ex. for key press event (using VB6) if (keyascii >= 65 and keyascii <= 90) and (keyascii >= 97 and keyascii <= 122) then ..... else ..... end if
Regards KP
-
Is there are a way to put an input mask or some type of validation on a text box? I either want to stop anything apart from upper and lowercase letters as they are typing in the box or Load an event on a button press if anything except uppercase and lowercase is in the box. Any ideas? Cheers in advance
In VB 2005 you can use a masked edit control. In earlier versions, you have to handle the KeyPress event and set e.Handled to true if the key is one you want to reject.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
In VB 2005 you can use a masked edit control. In earlier versions, you have to handle the KeyPress event and set e.Handled to true if the key is one you want to reject.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Hi, sorry, forgot to mention, its for VB.NET 2005. How does the mark edit control work? I have looked on MSDN but it doestn really help. I guess its nothing like excel's input mask!?
-
Hi, sorry, forgot to mention, its for VB.NET 2005. How does the mark edit control work? I have looked on MSDN but it doestn really help. I guess its nothing like excel's input mask!?
MSN has full documentation on how to write input masks for the masked input control. I don't really know, I always write my own code.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )