Numeric Style Textbox
From CShellVB http://www.cshellvb.com Change the style of a normal textbox so that it will only accept numbers. Better then evaluating keypress events and very fast. This call works on the fly and it is wrapped into a function for you.
AI
สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
ซอร์สโค้ด
'This function changes the style based on the flag Public Sub SetNumber(NumberText As TextBox, Flag As Boolean) Dim curstyle As Long Dim newstyle As Long 'This Function uses 2 API functions to set the style of 'a textbox so it will only accept numbers CShell curstyle = GetWindowLong(NumberText.hwnd, GWL_STYLE) If Flag Then curstyle = curstyle Or ES_NUMBER Else curstyle = curstyle And (Not ES_NUMBER) End If newstyle = SetWindowLong(NumberText.hwnd, GWL_STYLE, curstyle) NumberText.Refresh End Sub
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine