Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > How to apply an accelerator key to a button in VBNet 3.0
 

How to apply an accelerator key to a button in VBNet 3.0

I want a quickie control key to kick off the same code as a button, e.g. Control S will function the same as the Save button. Was easy in VB 6.0 but can not see how to do it on VB Net3.0
John Spencer  Tuesday, January 17, 2006 2:32 PM

have you tried events ? like this

Sub Save (ByVal sender As System.Object, ByVal e As System.EventArgs) handles Savebutton.click,Control_s.click

'put save code here

end sub

Remco


Edit:  o wait...... i didn't read your post properly

I missed the acelerator part. a thought control s as a control named s (duh)

When you change the text like this "&Save" then you got a acelerator of <Alt S>

Remco

 

RemcoJVG  Tuesday, January 17, 2006 3:15 PM

have you tried events ? like this

Sub Save (ByVal sender As System.Object, ByVal e As System.EventArgs) handles Savebutton.click,Control_s.click

'put save code here

end sub

Remco


Edit:  o wait...... i didn't read your post properly

I missed the acelerator part. a thought control s as a control named s (duh)

When you change the text like this "&Save" then you got a acelerator of <Alt S>

Remco

 

RemcoJVG  Tuesday, January 17, 2006 3:15 PM
Hey Remco - thanks again mate - you're a star!!
John Spencer  Tuesday, January 17, 2006 4:03 PM

You can use google to search for other answers

Custom Search

More Threads

• Bind datagridviewimagecolumn to remote folder of images
• Combo Box Problem with String Display Member and Number Value Member
• Datagridview optional display of decimal values
• Filtering Columns at Gridview
• How to get same Dateformat to a textbox from datetimepicker?
• VB generated Code
• DataGrid query problem...?
• Traversing rows in Filtered BindingSource
• Convert to UPPER when leaving the cell in a datagridview
• BindingSource Compound Find (Not Filter)