|
-
May 14th, 2000, 07:06 PM
#1
Thread Starter
Member
In my application there is on form which contains controls
including one multiline textbox and a command button for witch the 'Default' property is set to True.
If in the textbox if want type the next line the focus is shifting to command button and its click event is fired.
if i want to type next line in the textbox i have to press CTRL+Enter.
How can i avoid this
Thanks in advance.
-
May 14th, 2000, 08:11 PM
#2
Addicted Member
Do you have the Form's Keypress event set to "True" and
are you using the following?
Private Sub Form_KeyPress(KeyAscii As Integer)
'Set the Form's KeyPreview to True.
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
The above will enable the enter Key in lieu of Tab for
every item on the Form. If you start a new project with
just a TextBox (Multiline Property set to true) and add
a Command Button without the above then the Enter Key will
work correctly. You would have to set the Form's Keypress event to "False" and incorporate the above code into the
individual controls' keypress events to eliminate your problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|