472,121 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

bringing form to Top/Front

Hi there...hoping somebody can help me out because I am
almost ready to pull out my hair.

My problem is as follows:

In a method in my main form (non MDI app), I instantiate
and .Show another form. As a result of the .Show, the
form's Load event is called and I have a population
routine fires off. Normally, all is well and good and the
new form is active and gets displayed on top of the main
form.

I need to show a messagebox sometimes while populating the
new form, and whenever a messagebox is shown, the new form
always ends up "behind" the old form (but this only
happens when a messagebox is displayed).

After I .Show the form, I've all of the following tried
(not all at once):
newform.BringToFront()
.....
newform.Activate()
.....
oldform.SendToBack()
.....

In addition...I've tried setting the messagebox to be
displayed on the Activated event. I've tried using the
MessageBox owner parameter and passing in the form.

Does anyone have any ideas? Thanks very much for your
help.

Kevin
Nov 20 '05 #1
4 1658
Hi,

Why dont you try setting the topmost property of the newform to
true.

Ken
--------------------------
"Kevin Carter" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Hi there...hoping somebody can help me out because I am
almost ready to pull out my hair.

My problem is as follows:

In a method in my main form (non MDI app), I instantiate
and .Show another form. As a result of the .Show, the
form's Load event is called and I have a population
routine fires off. Normally, all is well and good and the
new form is active and gets displayed on top of the main
form.

I need to show a messagebox sometimes while populating the
new form, and whenever a messagebox is shown, the new form
always ends up "behind" the old form (but this only
happens when a messagebox is displayed).

After I .Show the form, I've all of the following tried
(not all at once):
newform.BringToFront()
....
newform.Activate()
....
oldform.SendToBack()
....

In addition...I've tried setting the messagebox to be
displayed on the Activated event. I've tried using the
MessageBox owner parameter and passing in the form.

Does anyone have any ideas? Thanks very much for your
help.

Kevin

Nov 20 '05 #2
Ken, I just tried that but that won't work because that
makes the child form always appear over the parent form.
(Plus there can be many instances of the same child
form.) Thanks for the suggestion, though.
-----Original Message-----
Hi,

Why dont you try setting the topmost property of the newform totrue.

Ken
--------------------------
"Kevin Carter" <an*******@discussions.microsoft.com> wrote in messagenews:03****************************@phx.gbl...
Hi there...hoping somebody can help me out because I am
almost ready to pull out my hair.

My problem is as follows:

In a method in my main form (non MDI app), I instantiate
and .Show another form. As a result of the .Show, the
form's Load event is called and I have a population
routine fires off. Normally, all is well and good and the new form is active and gets displayed on top of the main
form.

I need to show a messagebox sometimes while populating the new form, and whenever a messagebox is shown, the new form always ends up "behind" the old form (but this only
happens when a messagebox is displayed).

After I .Show the form, I've all of the following tried
(not all at once):
newform.BringToFront()
....
newform.Activate()
....
oldform.SendToBack()
....

In addition...I've tried setting the messagebox to be
displayed on the Activated event. I've tried using the
MessageBox owner parameter and passing in the form.

Does anyone have any ideas? Thanks very much for your
help.

Kevin

.

Nov 20 '05 #3
"Kevin Carter" <an*******@discussions.microsoft.com> schrieb
In a method in my main form (non MDI app), I instantiate
and .Show another form. As a result of the .Show, the
form's Load event is called and I have a population
routine fires off. Normally, all is well and good and the
new form is active and gets displayed on top of the main
form.

I need to show a messagebox sometimes while populating the
new form, and whenever a messagebox is shown, the new form
always ends up "behind" the old form (but this only
happens when a messagebox is displayed).

After I .Show the form, I've all of the following tried
(not all at once):
newform.BringToFront()
....
newform.Activate()
....
oldform.SendToBack()
....

In addition...I've tried setting the messagebox to be
displayed on the Activated event. I've tried using the
MessageBox owner parameter and passing in the form.

Does anyone have any ideas? Thanks very much for your
help.


Can you reproduce it in a new project? I tried to, but my second form is
shown in front of the first as expected.
--
Armin

http://learn.to/quote
http://www.plig.net/nnq/nquote.html

Nov 20 '05 #4
Hi,

last suggestion newform.focus

Ken
----------------
"Kevin Carter" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Ken, I just tried that but that won't work because that
makes the child form always appear over the parent form.
(Plus there can be many instances of the same child
form.) Thanks for the suggestion, though.
-----Original Message-----
Hi,

Why dont you try setting the topmost property of

the newform to
true.

Ken
--------------------------
"Kevin Carter" <an*******@discussions.microsoft.com>

wrote in message
news:03****************************@phx.gbl...
Hi there...hoping somebody can help me out because I am
almost ready to pull out my hair.

My problem is as follows:

In a method in my main form (non MDI app), I instantiate
and .Show another form. As a result of the .Show, the
form's Load event is called and I have a population
routine fires off. Normally, all is well and good and the new form is active and gets displayed on top of the main
form.

I need to show a messagebox sometimes while populating the new form, and whenever a messagebox is shown, the new form always ends up "behind" the old form (but this only
happens when a messagebox is displayed).

After I .Show the form, I've all of the following tried
(not all at once):
newform.BringToFront()
....
newform.Activate()
....
oldform.SendToBack()
....

In addition...I've tried setting the messagebox to be
displayed on the Activated event. I've tried using the
MessageBox owner parameter and passing in the form.

Does anyone have any ideas? Thanks very much for your
help.

Kevin

.

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Terry | last post: by
1 post views Thread by Kevin Carter | last post: by
3 posts views Thread by Richard L Rosenheim | last post: by
3 posts views Thread by John | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.