VB.NET Disable Parent Window on Show

余生长醉 提交于 2019-12-11 15:45:43

问题


How can I disable the parent form when I call a child form?

This code doesn't disable the parent form like I thought it would:

frmChild.ShowDialog()

回答1:


You can use

frmChild.ShowDialog(Me)

Me - is a parent form




回答2:


By disable, do you mean just prevent the user from clicking anything in the parent form? If so, then .ShowDialog is the way to do it - it makes the called form Modal, so that it controls the application's focus until it's closed.

If you're looking to fade the parent window out or do something else to make it obvious that it can't be clicked in, that's more complicated.

Can you elaborate with some detail about what's happening that's not what you expect?



来源:https://stackoverflow.com/questions/2838105/vb-net-disable-parent-window-on-show

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!