Modal form doesn't have focus if parent window is inactive

35 views
Skip to first unread message

tony....@gmail.com

unread,
Jul 26, 2006, 3:15:13 PM7/26/06
to
I have a main windows form called frmMain and another form called
frmLogin. I don't want frm Main to display until the user successfully
logins in. I call frmLogin.ShowModal from within the OnLoad event of
frmMain. This displays frmLogin but the focus is not really on the
form even though the cursor is blinking in the first textbox. If you
start typing, it windows will type into what ever is behind frmLogin.
So I found this article that solved my focus problem:

http://west-wind.com/weblog/posts/2080.aspx

However, now if I minimize a window that is behind frmLogin, frmLogin
is closed and frmMain is activated. Here are the steps to re-create:

1. Launch an App (say NotePad)
2. Launch frmMain which is not shown yet but shows frmLogin
3. Minimize Notepad
4. frmLogin is closed and frmMain is activated

Anyone have a clue?

Thanks,

Riki Wiki

unread,
Jul 29, 2006, 5:44:16 AM7/29/06
to
On 26 Jul 2006 12:15:13 -0700, tony....@gmail.com wrote:

> Anyone have a clue?

Hoi Tony

You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this news
group do not officially exist, the group to use is
b.p.d.vcl.components.using.general.

How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups>

dah...@gmail.com

unread,
Sep 27, 2012, 1:43:13 AM9/27/12
to
Hello unknown man... you most call the frmLogin before frmMain... thast the trick!
Reply all
Reply to author
Forward
0 new messages