Sign in to follow this  
Rifle_001

VB Question

Recommended Posts

I'm making a modding tool and I'm using Visual Basic and Microsoft Visual Basic 2008 Express Edition, I'm making the menus (File, Edit, Help, etc...) and I created the menu item, placed it, and I made the categories (File, Edit, Help) and then menu items in those menus (i.e. File->Quit) but I don't know how to program the commands for the menu items. In the properties it says Action and has Command, CommandParameter, and CommandTarget but I have no idea what the commands are and I've searched the Visual Studio documentation for about an hour, so if anyone could give me a link to the list of commands or something along that line I would really appreciate it. Thanks, Rifle

Share this post


Link to post
Share on other sites
Not sure if this is what you want to do, but on the menu editor, double click the item for which you want to add code - that will generate a handler where you can place your code.

Side tip: when you enter the name of the menu item you're creating, if you use an & on it "Te&st" that will define the letter "s" as the shortcut for that item.

Share this post


Link to post
Share on other sites
Ok, I figured out what I need to put in that menu (and no, i can double click on it because its within the MenuItem, basically a MenuItem of a MenuItem). All I had to do was type in an ICommand value (i.e. cut, copy, paste, all the others found in the ApplicationCommands (and the others) Class and such).

And that leads me to my next question, I want to write my own definition for the command "new" (that is found in the ApplicationCommands Class). However, Microsoft doesn't give much explanation (well not in the Visual Basic language anyway) on how to go about doing this so some help in the form of a code sample or link to a tutorial would be greatly appreciated.

Rifle

Share this post


Link to post
Share on other sites
Yes, you can double click on menu items, even when they're children of other menu items. That is how you add code to menu items.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this