[SOLVED] Add other controls to a ContextMenu?

Answered
0
0

Hi,

Is it possible to add other controls to a context menu?  I would like to have a user control, actually as a second level menu item.

So something like:
menuAddTraining.MenuItems.Add(new MyUserControl());
Which would then popup the user control in the location of menuAddTraining’s sub menu.

Cheers,
Neil

  • You must to post comments
Best Answer
0
0

You can’t add a panel as a menu item but you can show a UserPopup at the location of a menu item click:

var p = new UserPopup();
p.BackColor = Color.Red;
p.Size = new Size(100, 100);
p.ShowPopup(Control.MousePosition);

Menus are complex widgets managed by a manager component that takes care of opening/closing drop down menus with a timer, focus, opened state, etc.

You can also built a custom popup similar to the Windows start using the UserPopup. An example is here http://demo.wisej.com/codeproject. You can add more UserPoup that show like a custom menu.

 

  • Neil Brown
    Many thanks! I will give that a try.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.