Solved

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

Posted on 2013-12-06
5
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 300 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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Format Transaction Number 19 49
PowerShell:  Use of subproperties in a Select statement 7 69
Convert a string to date 4 40
XML and Linq - reading fields in repeating nodes 3 24
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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