Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Focus Problems with MDI child forms

0 views
Skip to first unread message

Trev Hunter

unread,
Feb 2, 2004, 11:12:33 AM2/2/04
to
Hi Folks,

Sorry if you have seen this post before - I've posted it before, but it
seems to have gotten lost in Outlook limbo - it's visible on the web
interface, but not in any news reader I've tried :S

A while ago, I came accross this post by Armin describing how to reporduce a
focus bug with MDI children. I am currently experiencing the same problem in
my application although I'm not using an ActiveX control directly on the
form as in Armin's example (my 3rd party toolbars and menus could be the
culprits though).

I'm using Visual Studio 2003 with .net 1.1 on Windows XP.

Any help would be greatly appreciated.

Trev.

Origional Post by Armin (edited) - see http://tinyurl.com/2ezw2 for
origional:
----------------------------------------------------------------------------
--
>Problem: A child can not be activated anymore by clicking in its
>client area. It can only be activated by clicking the title bar. Also
>the title bar does not always have the expected color depending on
>the focus. Is this a known bug? I googled and search MSFT KB but
>didn't find anything.

> Steps to reproduce:
> 1. New WindowsApplication
> 2. Add two new Forms (Form2 and Form3)
> 3. For Form1: Set IsMdiContainer=True
> 4. Add the following code to Form1:
>
> Private Sub Form1_Load( _
> ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles MyBase.Load
>
> Dim f2 As New Form2
> Dim f3 As New Form3
> f2.MdiParent = Me
> f2.Show()
> f3.MdiParent = Me
> f3.Show()
> End Sub
>
> 5. On Form3, add an ActiveX control, e.g. WebBrowser (shdocvw.dll)
> 6. Start


> Armin


Cor

unread,
Feb 2, 2004, 4:01:39 PM2/2/04
to
Hi Trev,

Is there a reason you did not include the newsgroup

microsoft.public.dotnet.languages.vb in it,

that is the group where Armin is the most active from the international
groups, but not in the ones you have included I thought.

And as far as I have seen in the newsgroup is Armin in the newsgroups one of
the real MDI experts.

If you even want to have more success you can ask it also in the German
language in the newsgroup

microsoft.de.german.entwickler.dotnet.vb

Cor


Trev Hunter

unread,
Feb 2, 2004, 6:00:07 PM2/2/04
to
Cor,

I didn't post it to the VB group because I thought it was a more generic
problem (hence the .windowsforms group). I added the .faq and .general
groups because I was having problems with the .windowsforms group and was
hoping for a better response. Surely someone else out there has come accross
this problem before? I'll do up a sample project and see if it is limited to
VB.

> that is the group where Armin is the most active

Thanks for the tip about Armin's whereabouts ;) He's the one who posted the
original article a while back, but there was no responses to that. Next time
I see him in a group, I'll discretely OT the thread and ask him.

> If you even want to have more success you
> can ask it also in the German
> language in the newsgroup

Unfortunately I can't speak German - only English, VB and passable C# ;)

Thanks again for the tip,

Trev.


"Cor" <n...@non.com> wrote in message
news:%23gDzPAd...@TK2MSFTNGP10.phx.gbl...

Ying-Shen Yu[MSFT]

unread,
Feb 3, 2004, 6:57:46 AM2/3/04
to
Hi Trev,

Thanks for letting us know this issue,
I was successfully reproduced it follow the steps. I'm contacting the
product group and let them take a look at it, I'd appreciate your patience
while we investigating this issue,
Thanks for your understanding!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.

Trev Hunter

unread,
Feb 3, 2004, 7:15:20 AM2/3/04
to
Thanks for investigating this for me. I'll post here if I come accross any
more information regarding this issue.

Best Regards,


Trev.


""Ying-Shen Yu[MSFT]"" <v-...@online.microsoft.com> wrote in message
news:BUJd3zk6...@cpmsftngxa07.phx.gbl...

Ying-Shen Yu[MSFT]

unread,
Feb 10, 2004, 11:29:01 PM2/10/04
to
Hi Trev,
I apologize for the long delay,
I have confirmed this issue with our product group.

The native mdi form does not seem to get the WM_ACTIVATE message, but it
gets the WM_MOUSEACTIVATE message. We may create a derived form for MDI
Child Forms and override the WndProc like the following code snippet to
work around this issue.

<code>
protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
case 0x21: // WM_MOUSEACTIVATE
this.Activate();
base.WndProc(ref m);
break;

default:
base.WndProc(ref m);
break;
}
}
</code>

Thanks!

Trev Hunter

unread,
Feb 11, 2004, 9:21:29 AM2/11/04
to
Thanks for the help. I used your code by implementing a base class for all
my MDI child forms to inherit from and overriding the WndProc method in the
base class.

Thanks again,

Trev.

""Ying-Shen Yu[MSFT]"" <v-...@online.microsoft.com> wrote in message

news:nvICjeF8...@cpmsftngxa07.phx.gbl...

0 new messages