As Ajay suggests if you use an SDI or MDI app with a CFormView rather than
a dialog app you could use this mechanism very easily. I've used it for all
kinds of controls.
Most of the time I will, instead, create a function called SetControlState()
that gets called when something changes (like a checkbox is checked). In
that function I simply use EnableWindow() ShowWindow() or whateverWindow()
to set the controls the way I want them based on the state of the program.
The reason the ON_UPDATE_COMMAND_UI mechanism is useful for menus and
toolbar buttons is that the calls are made as the menu or toolbar is being
drawn. In a dialog you'll have to call OnInitMenuPopup() to get the
mechanism to work right (I.E., for a popup context menu).
"Peter" <Peter@discussions.microsoft.com> wrote in message
ON_UPDATE_COMMAND_UI is great thing but I know only how to use it for
and toolbar buttons.
Is possible to use ON_UPDATE_COMMAND_UI for items other than menus and
toolbar buttons ? For example for normal buttons, edit boxes, static texts
etc. placed on dialog ?