S
SugarDaddy
I'm pretty new to C#, but I've had a lot of experience with MFC. MFC
had a mechanism for updating dialog controls using an idle message.
For those unfamiliar, basically you would override OnIdle and call
UpdateDialogControls(), and that would send WM_UPDATECOMMANDUI messages
to all the controls in the dialog. Then you could add handlers for
each control that you wanted to update. For example, if you wanted a
button to be disabled if some text box was empty, you would add the
UpdateCommandUI handler for the button that would check the state of
the text box. It was very useful, and completely undetectable as far
as the user goes (no flicker).
I can't seem to find that kind of mechanism in C#. I can create an
Idle handler for the application and call Update() for all the
controls, but the handler for Update isn't called unless the control is
invalidated -- so that's no good. So I've tried calling Invalidate(),
and then create a handler for Invalidate on each control. However, by
calling invalidate, it creates an annoying flicker in many controls --
basically any control that's not a button.
I figure there must be a way, and microsoft wouldn't completely leave
it out, but I could be wrong. Any help would be appreciated.
had a mechanism for updating dialog controls using an idle message.
For those unfamiliar, basically you would override OnIdle and call
UpdateDialogControls(), and that would send WM_UPDATECOMMANDUI messages
to all the controls in the dialog. Then you could add handlers for
each control that you wanted to update. For example, if you wanted a
button to be disabled if some text box was empty, you would add the
UpdateCommandUI handler for the button that would check the state of
the text box. It was very useful, and completely undetectable as far
as the user goes (no flicker).
I can't seem to find that kind of mechanism in C#. I can create an
Idle handler for the application and call Update() for all the
controls, but the handler for Update isn't called unless the control is
invalidated -- so that's no good. So I've tried calling Invalidate(),
and then create a handler for Invalidate on each control. However, by
calling invalidate, it creates an annoying flicker in many controls --
basically any control that's not a button.
I figure there must be a way, and microsoft wouldn't completely leave
it out, but I could be wrong. Any help would be appreciated.