Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 97 To 122, 65 To 90, 8, 32
[green]'97 to 122 a to z
'65 to 90 A to Z
'8 Backspace
'32 Space[/green]
Case Else
KeyAscii = 0
End Select
End Sub
If strEval Like "*[!a-zA-Z]*" Then
IsAlpha = False
Else
IsAlpha = True
End If
OptionExplicit
Private Const EM_UNDO = &HC7
Private Const EM_EMPTYUNDOBUFFER = &HCD
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Sub Text1_Change()
Static bCancel As Boolean
If (Text1.Text Like "*[!a-zA-Z ]*") Then
bCancel = True
SendMessage Text1.hWnd, WM_UNDO, 0&, 0&
Text1.SelStart = Len(Text1.Text)
End If
SendMessage Text1.hwnd, EM_EMPTYUNDOBUFFER, 0&, 0&
bCancel = False
End Sub
Option Explicit
Private Const EM_CANUNDO = &HC6
Private Const EM_UNDO = &HC7
Private Const EM_EMPTYUNDOBUFFER = &HCD
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Text1_Change()
If (Text1.Text Like "*[!a-zA-Z ]*") Then
If SendMessage(Text1.hwnd, EM_CANUNDO, 0&, 0&) = 0 Then
Text1.Text = vbNullString
Else
SendMessage Text1.hwnd, EM_UNDO, 0&, 0&
Text1.SelStart = Len(Text1.Text)
End If
End If
SendMessage Text1.hwnd, EM_EMPTYUNDOBUFFER, 0&, 0&
End Sub
[b]
Private Sub Text1_Change()
If (Text1.Text Like "*[!a-zA-Z ]*") Then
If (Text1.Tag Like "*[a-zA-Z ]*") Then
Text1.Text = Text1.Tag
Text1.SelStart = Len(Text1.Text)
Else
Text1.Text = vbNullString
End If
End If
Text1.Tag = Text1.Text
End Sub
[/b][