Question:
I created notepad using visual basic only problem how to create short cuts..?
?
2009-09-06 06:04:42 UTC
Example New,open,save,print,undo,redo,copy,paste,cut,delete
Three answers:
?
2009-09-06 09:18:47 UTC
If you are using Buttons you can make the button respond to ALT+ shortcuts. (Thiscan also be done on menu items)



In the text property of a command button place an ampersand (&) infront of the character you want to use with the ALT button



For example the new button text propert would be "&New" . The displayed text on the button would be New with the N underlined.



When you press ALT+N that buttons click event will fire.



You can only use one letter in a container at a time. Meaning that buttons for New and Next cannot both use the N you have to use distinct letters &New and Ne&xt for example ALt+N = new and ALT+X = Next





You can use this technique on buttons and menu items and is preferred to the use of shortcuts for other than standard shrtcut items.



Meaning for example CTRL+C is a well defined windows short cut that most people associate with copy. You do not want to associate this short cut in your program with Close for example.. Its OK to use this if you program a Copy function you then want to make the CTRL+C short cut operate your code to "Copy"
hero no .1
2009-09-06 06:28:26 UTC
Using Menu Editor , right Click on the Form and choose Menu Editor

And u r done !

Give a name to the menu and then a caption however after that you will have to give appropriate code to each menu you created !



Good Luck
?
2009-09-06 08:56:40 UTC
If you're using VB6, you can right click the form or white-space on the workspace and select Menu editor. You can add menu items and set shortcut keys too.



If you're using VB.NET, add a MenuStrip item from the Toolbox and add menu items. The 'Shortcut Keys' can be set using the Properties dialog for each menu item.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...