Failed_Noob
Failed_Noob

Reputation: 1357

How to make a form always stay on top of another form

How to make a form always stay on top of another form.

Also both form's enabled property must be true

I don't wanna make use of topmost property.

Edit 1 :

Another similar question in C# says you can use Form.Owner Property to do the trick , how to make use of this property ?

Edit 2 : The Owner Property works fine untill I try to open it the second time.

This is the error message I get

enter image description here

Upvotes: 0

Views: 13384

Answers (1)

V4Vendetta
V4Vendetta

Reputation: 38210

I believe you need the frm.ShowDialog() instead of frm.Show()

frm is the other form you need to show over your current form and instead of using Show, this will make it as a dialog form over your current form (however you won't be able to select the parent form or the form behind it unless you close the frm form

EDIT

To enable edit on both forms

Form2 frm = new Form2();
frm.Owner = this;
frm.Show();

Hope this helps you out.

Upvotes: 2

Related Questions