A
andreas.baus
Is there any way for a MDI child form to be notified when it's parent
receives focus? In my example, I have a MDI application with several
child forms, and one of them contains a "Paste from Clipboard" button
which I want to dynamically enable/disable depending on whether there's
actually any data in the clipboard in a format that I can make use of.
I wanted to do the check and update when the form receives focus, but
unfortunately events like "Enter" on the child window only fire when
the focus switches among the child windows of the same parent. However,
if I switch focus to another application (to copy something to the
clipboard), then swtich back to my own app, the child form receives no
such event. So I was wondering if there was some other way to keep the
button up-to-date.
Trying to attach to the MDIParent's events didn't work (with something
like
"this.MdiParent.Enter += new EventHandler(GotFocus);").
Any suggestions are welcome.
receives focus? In my example, I have a MDI application with several
child forms, and one of them contains a "Paste from Clipboard" button
which I want to dynamically enable/disable depending on whether there's
actually any data in the clipboard in a format that I can make use of.
I wanted to do the check and update when the form receives focus, but
unfortunately events like "Enter" on the child window only fire when
the focus switches among the child windows of the same parent. However,
if I switch focus to another application (to copy something to the
clipboard), then swtich back to my own app, the child form receives no
such event. So I was wondering if there was some other way to keep the
button up-to-date.
Trying to attach to the MDIParent's events didn't work (with something
like
"this.MdiParent.Enter += new EventHandler(GotFocus);").
Any suggestions are welcome.