Key_Press() event for text box

vb6 , key_press , textbox Pakistan
  • 12 years ago
    I have added a text box in rtb. I want to call KeyPress() event of rtb for the text box. How can i do that
  • 12 years ago
    Hi, If you want to handle key presses then try: Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) MsgBox Chr(KeyAscii) End Sub If you want to send a key press to the textbox use: TextBox1.SetFocus SendKeys ("a") This will cause the KeyPress event to fire which can be handled with the first code example. What are you tring to achieve with the code? Regards Aquila

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“To iterate is human, to recurse divine” - L. Peter Deutsch