Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to make sure that a form open infront of another form

Posted on 2013-12-06
5
Medium Priority
?
260 Views
Last Modified: 2013-12-10
Is there any catch or any way I can make sure a form being called from the original form always opens up in front of that original form? I sometimes get the second form show up behind the first form?

Thanks in advance.
0
Comment
Question by:cmdolcet
  • 2
  • 2
5 Comments
 
LVL 17

Expert Comment

by:Chris Millard
ID: 39700834
You could use Me.Activate() as the first command when the second form loads.
0
 

Author Comment

by:cmdolcet
ID: 39700850
Is this before the say for example form2.show?
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1200 total points
ID: 39700948
Do you have the TopMost property of the second form set to True?
0
 

Author Comment

by:cmdolcet
ID: 39701039
I can check, should I also check to see if I have it set on form form1?
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39701046
I cannot remember who wins out if two forms have TopMost set, and one form shows the other. If you don't need to be able to access the main form while the second form is displayed, then showing the second form via ShowDialog should give the desired effect (without having to set TopMost). The second form will be modal, so you won't have access to the main form until the second form is closed.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question