MDI Children don't get Focus

M

Maqsood Ahmed

Hello,
We are converting our product from Dot net Framework v1.0 to Dot net
Framework v1.1 and experiencing some problems regarding it. In our MDI
Application, any Child window doesn't activate on mouse click in Client
Area, whenever we open/close any Child form that hosts ActiveX control (such
as Acrobat Reader or MS Web Browser). It activates only when one click at
Form Title. One can perform all functions on the particular form, but it
doesn't get fully visible (active) unless its title is clicked. One more
thing, when I close
all open MDI children, and reopen them, application starts to work fine. Has
anybody experienced such problem? Any suggestions?
Bye.
 
J

JohnLiu

Maqsood Ahmed said:
Hello,
We are converting our product from Dot net Framework v1.0 to Dot net
Framework v1.1 and experiencing some problems regarding it. In our MDI
Application, any Child window doesn't activate on mouse click in Client
Area, whenever we open/close any Child form that hosts ActiveX control (such
as Acrobat Reader or MS Web Browser). It activates only when one click at
Form Title. One can perform all functions on the particular form, but it
doesn't get fully visible (active) unless its title is clicked. One more
thing, when I close
all open MDI children, and reopen them, application starts to work fine. Has
anybody experienced such problem? Any suggestions?
Bye.

Yes.
Trick is to hijack the MOUSEACTIVATE event and call Activate on the
form.
If you are going to use this on multiple forms, it may be easier to
put this in a baseform and then inherit from this.

(Our particular project was VB.NET)

Protected Overrides Sub WndProc(ByRef m As Message)
Select Case m.Msg
Case &H21 ' WM_MOUSEACTIVATE
Me.Activate()
End Select
MyBase.WndProc(m)
End Sub

jliu - www.ssw.com.au
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top