pak_slm
asked on
text box selection when execute form
1. i design a form so i want that when text box got focus previously displayed values should be selected.
if i want to change the value simply i press delete key from the keyboard and enter new value.
2.
what is the way when i input value in text box it convert in caps whenever caps lock key is off.
if i want to change the value simply i press delete key from the keyboard and enter new value.
2.
what is the way when i input value in text box it convert in caps whenever caps lock key is off.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops, Private Sub Text1_Click() should be: Private Sub Text1_GotFocus()
Hi, Why "C" is graded?!
Grade changed; comment (as corrected) is accurate, simple and works.
pak_slm,
A simple answer is usually the best answer. Please do not grade based on the number of characters typed into a response, but rather on whether or not you understand it and use it.
Netminder
Community Support Moderator
Experts Exchange
pak_slm,
A simple answer is usually the best answer. Please do not grade based on the number of characters typed into a response, but rather on whether or not you understand it and use it.
Netminder
Community Support Moderator
Experts Exchange
1. On gotfocus for selecting text write following code.
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
2. For caps
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then KeyAscii = KeyAscii - 32
End Sub