开发者

Show the window form modally on the other form

开发者 https://www.devze.com 2022-12-13 14:55 出处:网络
I have a window form named form1 and on 开发者_开发技巧that I want to show another window form named form2 modally so that user cannot click on anything else until the form2 is closed but user can sel

I have a window form named form1 and on 开发者_开发技巧that I want to show another window form named form2 modally so that user cannot click on anything else until the form2 is closed but user can select only the textbox displayed on form1.


use the following code in Form1:

form2.ShowDialog();


I think, it would be better if you use textbox on form2 and use form2.showdialog() in form1


Maybe you can use a modeless form2, and disable all user control in form1 except the Textbox on form1.

0

精彩评论

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