I digit ABCD in this textbox and insted to have ABCD see image!!!!
code:
Private Sub Text11_Change()
Text11.Text = UCase(Text11.Text)
End Sub
in effect i need to write always in ucase into textbox independent if i use a caps or shift down
Ghost in text box
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Ghost in text box
You do not have the required permissions to view the files attached to this post.
Last edited by HansV on 22 Oct 2011, 21:29, edited 1 time in total.
Reason: to remove white space from screenshot
Reason: to remove white space from screenshot
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Ghost in text box
Try using the After Update event of the text box instead of the Change event:
The code will fire when the user moves to a different control.
Code: Select all
Private Sub Text11_AfterUpdate()
Text11.Text = UCase(Text11.Text)
End Sub
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: Ghost in text box
i dont see AfterUpdate in the list of textbox this property... see imageHansV wrote:Try using the After Update event of the text box instead of the Change event:
The code will fire when the user moves to a different control.Code: Select all
Private Sub Text11_AfterUpdate() Text11.Text = UCase(Text11.Text) End Sub
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Ghost in text box
I always forget you're using VB6.
Have you perhaps set the RightToLeft property of the text box to True?
Have you perhaps set the RightToLeft property of the text box to True?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: Ghost in text box
i just have see... no is falseHansV wrote:I always forget you're using VB6.
Have you perhaps set the RightToLeft property of the text box to True?
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Ghost in text box
Thanks for checking. What if you use the KeyPress event instead of the Change event?
Code: Select all
Private Sub Text11_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 97 To 122
KeyAscii = KeyAscii - 32
End Select
End Sub
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: Ghost in text box
You are a genius!HansV wrote:Thanks for checking. What if you use the KeyPress event instead of the Change event?
Code: Select all
Private Sub Text11_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 97 To 122 KeyAscii = KeyAscii - 32 End Select End Sub