[英]Same code doing two different things on two different apps?
If I have this code: 如果我有此代码:
class TestBrowser : WebBrowser
{
public TestBrowser()
{
Panel panel = new Panel();
panel.Dock = DockStyle.Fill;
Controls.Add(panel);
}
}
Should the panel cover the WebBrowser
and make it invisible or not? 面板是否应该覆盖
WebBrowser
并使它不可见? What would it be the expected behavior? 预期的行为是什么? I ask this because this same code is giving me two different results on two different apps and can't find why (the panel covers it on one and is invisible in the other).
我之所以这样问,是因为相同的代码在两个不同的应用程序上给了我两个不同的结果,并且找不到原因(面板将其覆盖在一个应用程序上,而在另一个显示窗口中则看不见)。
如果将新控件添加到面板-将ID添加到面板-定义一个函数,该函数将在将控件添加到TestBrowser实例中包含的面板本身后更改Dock属性值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.