TNA
TNA

Reputation: 616

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.

Upvotes: 3

Views: 1108

Answers (2)

Ash
Ash

Reputation: 1984

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();

Upvotes: 2

GvS
GvS

Reputation: 52528

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.

Upvotes: 1

Related Questions