[RESOLVED] Adding menu items
Hi,
I downloaded a nice menu control from this webpage
http://www.codeproject.com/KB/menus/VistaMenu.aspx.
I added the control to my toolbox, and dragged and dropped it onto my form.
The problem is I can't see any way of adding men items.
There is a property named items, but that doesn't seem to add menu items to the menu. There doesn't seem to be any other property that would add the items.
I'm also wondering if there is a way of adding code to add the menu items.
If there is, could someone show me how
Kareem
Re: adding items to menu control
Right on the page the author documents the methods
Code:
public VistaMenuItem Add(string sText);
public VistaMenuItem Add(string sText, string sDescription);
public VistaMenuItem Add(string sText, string sDescription, Image img);
public VistaMenuItem Add(string sText, Image img);
public void Add(VistaMenuItem btn);
Code:
for(int idx = 0; idx < 5; idx++)
vmcMenu.MenuItems.Add(
"Item " + idx,
"Description " + idx,
img
);
Re: adding items to menu control
Quote:
Originally Posted by
kevininstructor
Right on the page the author documents the methods
Code:
public VistaMenuItem Add(string sText);
public VistaMenuItem Add(string sText, string sDescription);
public VistaMenuItem Add(string sText, string sDescription, Image img);
public VistaMenuItem Add(string sText, Image img);
public void Add(VistaMenuItem btn);
Code:
for(int idx = 0; idx < 5; idx++)
vmcMenu.MenuItems.Add(
"Item " + idx,
"Description " + idx,
img
);
Which is exactly what I said the first time this question was posted. Please do not, under any circumstances, post the same question twice. It is against forum "rules". If you don't feel you have the information you need then post to your existing thread asking for more information.
Of course, in this case you already had the information. You just weren't using it.