Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Menu, Application Menu, Context Menu > sub-menu images?

Answered sub-menu images?

Feed from this thread
  • Ian avatar

    Posted on Apr 27, 2011 (permalink)

    Hi Telerik

    I am trying to set the image Index for sub menu items in the items collection of a context menu item.

    The ImageIndex property of the sub-menu items does not show the imagelist images associated with the context menu.

    How can I get these images to appear on the sub menu items collection?

    Regards
    Ian Carson

    Reply

  • Posted on Apr 29, 2011 (permalink)

    Hello Ian,

    Just retrieve the corresponding item, and get the image from either the menu.ImageList or the image list itself, like so:
    var menu = new RadMenu();
    var menuItem = new RadMenuItem("Some menuItem");
    menu.Items.Add(menuItem);
    menu.ImageList = imageList1;
    menuItem.ImageIndex = 1;
    var subMenuItem = new RadMenuItem("Some submenuItem");
    subMenuItem.Image = menu.ImageList.Images[1];
    menuItem.Items.Add(subMenuItem);

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Menu, Application Menu, Context Menu > sub-menu images?