Here is a code segment help to achieve this task. This is helpful,when we developing a accounting software or buisiness softwares.
This code only works for VB 6.0 and not works for ‘pasting’ event.
Follow the instruction:
- Place the following code in the module part of your project.
- Call this function in the ‘Keypress’ event of
textbox.
Public Function SetNumericTextBox(Textbox As Textbox, KeyAscii)
If KeyAscii = vbKeyMenu Then
KeyAscii = 0
End IfIf KeyAscii 8 Then
If KeyAscii = Asc(“.”) Then
If InStr(1, Textbox.Text, “.”) >= 1 Then
KeyAscii = 0
End If
End If
If InStr(1, “0123456789.”, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End IfEnd Function
Thanking You
Shahul Hameed
e-mail:sinuxcreation@gmail.com
One Response to “Able to change textbox into a numerical(decimal) textbox in VB 6.0?”
Trackbacks/Pingbacks
- Tweets that mention Able to change textbox into a numerical(decimal) textbox in VB 6.0? | CeTly L!ve - College of Engineering Thalassery Live -- Topsy.com - [...] This post was mentioned on Twitter by CeTly L!ve. CeTly L!ve said: Able to change textbox into a numerical(decimal) ...





hola..!