简体   繁体   English

对话框和消息框是否为“添加的控件”?

[英]Are Dialog Boxes & Message Boxes “Added Controls”?

When you call MessageBox.Show() or Form.ShowDialog() or Form.Show() is the form/ modal dialog added to the caller/parent Form or Control? 当您调用MessageBox.Show()Form.ShowDialog()Form.Show()是否将窗体/模式对话框添加到调用方/父窗体或控件中? Does this only happen if you specify a parent, such as Form.ShowDialog(this) ? 仅当您指定诸如Form.ShowDialog(this)的父对象时,才会发生这种情况吗?

I'm asking because I'm extending the System.Windows.Forms.Panel class to add additional constraints such as max # of direct children controls and only allowing specified Type s of Controls to be added. 我之所以问是因为我正在扩展System.Windows.Forms.Panel类以添加其他约束,例如直接子控件的max#,并且仅允许添加指定的Type控件。 I want to make sure though that Dialog & Message boxes are not affected by these constraints (unless specifically requested). 我想确保“对话框和消息”框不受这些约束的影响(除非特别要求)。 There does not seem to be much information on this topic out there; 似乎有关该主题的信息很少。 probably because none of the container controls have these restrictions out of the box. 可能是因为没有一个容器控件具有开箱即用的这些限制。

No ! 不行 Dialog boxes are not added to the caller/parent Form or Control. 对话框不会添加到调用方/父窗体或控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM