webwebwebweb
asked on
enter button hit runs button code
I have a textbox and a button, Once the user types in this textbox and then clicks enter, the code for the button should run,how is this done?
Also how can you get _ in the title of tabpages?
Also how can you get _ in the title of tabpages?
ASKER
sorry i mean not for a particular text box but for the form.
if im doing anything on the form and press enter i want the button ones code to be run. sorry dude
the second answer wont work, usually on menus or wateva i wud go F&ile to bring it up with the underline so the user can then use alt and wateva letter
if im doing anything on the form and press enter i want the button ones code to be run. sorry dude
the second answer wont work, usually on menus or wateva i wud go F&ile to bring it up with the underline so the user can then use alt and wateva letter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can always set
Form.AcceptButton = myButton
Form.AcceptButton = myButton
for the question how can you get _ in the title of tabpages?
There is no accelarator key for this control.
There is no accelarator key for this control.
Private Sub txtInput_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPr
If e.KeyChar = ControlChars.Cr Then ' if enter was pressed
e.Handled = True ' get rid of annoying beep
Button1_Click(Nothing, Nothing) ' run Button1_Click code
End If
End Sub
Second question:
Select your TabControl.
In the TabPages property, click on the three dots "..."
Select the TabPage you want to modify.
Find the Text property on the right side of the dialog.
Edit it, adding your underscore where you want it.
Press OK.