Setting state of menu-items ?

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

In .NET , when working with menus handlers :
Is there an equivalent of an in MFC used event : UPDATE_COMMAND_UI ?

For those not familiar with the name UPDATE_COMMAND_UI :
it is an event that is fired when one clicks on a topmenu-item (not a
childmenu-item)
(example of a topmenu-item : 'Edit ' and childmenu-item would then be
'Paste' or 'Copy')

This event is called as many times as there are childmenu-items in the
top-menu and thus enabling you to set the state of each individual
childmenu-item (enabled, checked,...) BEFORE the dropdown-menu is shown.

Anybody knows ?
Thnx

Christian
 
U can use the On_Select event for the top-menu item u want to have this
feature . Then in the triggered event set the states of the child-menu
items.

so it should be something like this

private void On_Select_MenuItem1 (..., ....)
{
MenuItem2.Enabled = false;
MenuItem3.Visible = false;
// ......
}

hope this helps
 
Back
Top