开发者

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

How to make a form always st开发者_如何转开发ay 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

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜