Re: ON_UPDATE_COMMAND_UI
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).
http://msdn.microsoft.com/en-us/library/9k665199(VS.80).aspx
Tom
"Peter" <Peter@discussions.microsoft.com> wrote in message
news:158E164B-878E-4F3F-82F5-A521825E585E@microsoft.com...
Hi,
ON_UPDATE_COMMAND_UI is great thing but I know only how to use it for
menus
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 ?
Peter