- Home
·
- Miscellaneous
·
- Use SetWindowLong API call to make a text box only accept numeric input (0-9)
Use SetWindowLong API call to make a text box only accept numeric input (0-9)
Use SetWindowLong API call to make a text box only accept numeric input (0-9)
API Declarations
Private Const ES_NUMBER = &H2000
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Rate Use SetWindowLong API call to make a text box only accept numeric input (0-9)
(2(2 Vote))
Dim lngHwnd As Long
Dim lngReturn As Long
lngHwnd = GetWindowLong(Text1.hwnd, GWL_STYLE)
lngReturn = SetWindowLong(Text1.hwnd, GWL_STYLE, lngHwnd Or ES_NUMBER)
Use SetWindowLong API call to make a text box only accept numeric input (0-9) Comments
No comments yet — be the first to post one!
Post a Comment