|
-
Mar 21st, 2011, 03:53 AM
#1
Thread Starter
New Member
Bringing All Forms Back To Front
In VB6, if you have multiple windows forms open as part of one project, if you click one form, it brings all of them back into focus.
However in .NET it seems to only bring back the one form you click on.
Is there any way to replicate this behaviour in .NET so that it brings all of them back?
-
Apr 5th, 2011, 12:41 PM
#2
Re: Bringing All Forms Back To Front
Probably this post doesn't belong in the Architecture forum, but it's easy to answer. Make the main form the Owner of all the other forms. For example, set their Owner property (in code) to the main form. There are other ways such as the Form.AddOwnedForm method and Form.Show(owner). The result is that the Owned forms always stay in front of their Owner. BB
-
Apr 5th, 2011, 11:46 PM
#3
Re: Bringing All Forms Back To Front
 Originally Posted by boops boops
Probably this post doesn't belong in the Architecture forum, but it's easy to answer. Make the main form the Owner of all the other forms. For example, set their Owner property (in code) to the main form. There are other ways such as the Form.AddOwnedForm method and Form.Show(owner). The result is that the Owned forms always stay in front of their Owner. BB
That's not the same behaviour as VB6.
I was thinking that you might be able to hack something by setting the TopMost property of each form and then resetting it. You'd have to know the z-order then though, which would probably require API calls.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|