wyDay blog  |  Downloads  |  Buy
LimeLM
wyBuild
Support forum
wyDay blog
wyDay Home

Vistamenu - Adding images through code

bjbinc

I'm trying to use the vistamenu1.setimages to assign images to dynamically created context menuitems. It works great for first level items, but I cannot get it to work for sub items. Please help.

Mar 30, '10permalink
bjbinc

I now realize that I cannot even set images in design mode for submenus

Mar 30, '10permalink

It works for me, can you send me a simple example that's not working?

Send it to wyatt@wyday.com .

Mar 30, '10permalink
bjbinc

Thanks for the reply. I sent you a small example. I appreciate any help.

Mar 31, '10permalink

Thanks for spotting this - I'll try to work on a fix this weekend.

Apr 1, '10permalink
bjbinc

THANK YOU!!! I was so bummed when it didn't work cuz I really need it.

Apr 1, '10permalink
bjbinc

Any luck???

Apr 4, '10permalink

Yes. This is a definitely a bug on our part. We'll have a new release out a little later this week.

Apr 4, '10permalink

I've uploaded the latest version of VistaMenu. It fixes a few other bugs. But the bug you saw was due to a bug in Microsoft's implementation of the ContextMenu control.

The way to get around the bug is to set the Form's "ContextMenu" property to the context menu you want to use:

this.ContextMenu = contextMenu1;

Instead of dynamically showing the context menu using contextMenu1.Show()

That should work for you.

Apr 5, '10permalink
bjbinc

Thank you! That works. All I had to do was set the form's context menu and I'm still able to show it through contextmenu1.show() which is great because that is unavoidable in my case.

Apr 5, '10permalink
PwnYOU

im using

private void menuDropDownButton_Click(object sender, EventArgs e) { contextMenu1.Show(statusStrip1, new Point(506, 25)); }

to show menu, how in my case fix this bug with icons?

Jul 31, '15permalink

What's the question? What problem are you having? A lot more information is needed, starting with what you're trying to do, what you expect to happen, and what is actually happening.

Jul 31, '15permalink
PwnYOU

Icons doesn't work for sub items. this.ContextMenu = contextMenu1; doesent help

This code shows how I open the menu:

private void menuDropDownButton_Click(object sender, EventArgs e){contextMenu1.Show(statusStrip1, new Point(506, 25));}

And also shortcuts for menu items doesn't work.

Aug 1, '15permalink
Zer0th

I've got an image on the parent of a sub-menu that vanishes when the sub-menu pops up. The problem relates to the dynamically deleted/created child MenuItems in the parent's popup event. Changed to purely static content, the parent image remains. Essentially...

while (mnu.MenuItems.Count > 4) {....mnu.MenuItems.RemoveAt(2);}

foreach (string str in whatever) {...MenuItem item = new MenuItem(str);

....mnu.MenuItems.Add(mnu.MenuItems.Count - 2, item);

Any ideas?

Jul 30, '16permalink