tags:

views:

37

answers:

3
+2  Q: 

C# topmost window

I have two windows form and both set the topmost property to true. But the form border style of the one form is Set to "None". The other form has border. When these two forms launch together, the one without the border is always on top and overlap the other form. How do i make the form with border always on top? thanks.

+1  A: 

Show (make Visible) the window that is supposed to be on top, later as the other window.

Topmost only works between non-topmost and topmost windows. Between Topmost windows, the normal rules apply of what window to show.

GvS
+1  A: 

I suggest you to start the form with borders last or set other form TopMost property to false.

[Edit] I sugest you to look at the Forms Owner property - http://msdn.microsoft.com/en-us/library/system.windows.forms.form.owner.aspx.

formWithoutBorders.AddOwnedForm(borderForm);
borderForm.Show();
Andriy Shvay
I cannot, the one without border needs to run first. The second form is sth like config. Depending on the first one, it needs to run. Is there any thing to overwrite all the existing top most?
David
A: 

To understand why this is happening, I recommend Raymond Chen's What if two programs did this article

ohadsc