Re: Modal form doesn't get the focus....

From: James Hancock (nospamjhancock_at_darwinproductions.ca)
Date: 04/02/04


Date: Thu, 1 Apr 2004 23:29:17 -0500

This is actually a bug in Windows API and has been since Windows 3.x How it
made it into Windows 95 is beyond me, but it lives to this day. You can
really magnify this problem (they're related if you watch the wndprc) by
opening a Dialog and then opening another Dialog on top of that. In .net
closing the top most dialog closes the parent dialog too at the same time if
you return a positive DialogResult. In VB6 the same thing results in the
application losing focus to the next application in the task list. (You can
also get this behaviour with .net too, but you have to work a little harder
and use MDI children to do it.)

I reported this in V1 of the .net framework and V1.1 and now V2 and every
time it's been closed as not fixable.

James Han***

"Albert Tollkuçi" <albert@shqiperia.com> wrote in message
news:OqRGxOsAEHA.3004@TK2MSFTNGP10.phx.gbl...
> Hi guys,
> The MainForm of my application is not visible at startup. In the
> contructor
> I show a modal dialog (the login form) and I want to set the focus to
> this
> form. I have tried a lot of options but it doesn't work.
> Any help is appreciated.
>
> Thanx,
> Albert
>
>