面板组隐形/可见

发布于 2024-11-28 23:21:54 字数 95 浏览 1 评论 0原文

当我在构造函数中设置表单面板不可见时,我无法将其设置为可见。我设置Visible = true,但是不会显示。有人看到同样的问题并可以给我提示,如何解决这个问题或者原因是什么?

When I set a panel of a form invisible in the constructor, I cannot set it to visible after. I set Visible = true, but it will not be shown. Does somebody seen the same problem and can give me a tip, how to solve this or whats the reason for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

静若繁花 2024-12-05 23:21:54

我尝试创建一个带有面板的表单,并将其在构造函​​数中设置为不可见

public Form1()
{
    InitializeComponent();
    panel1.Visible = false;
}

,并在其后面显示一个按钮,该按钮显示该面板:

private void button1_Click(object sender, EventArgs e)
{
     panel1.Visible = true;
}

并且一切正常。

也许将您的代码放在这里,这样我或其他人就可以提供帮助。

I try to create a Form with a Panel, and set it to invisible in the constructor

public Form1()
{
    InitializeComponent();
    panel1.Visible = false;
}

and a button which shows that Panel after it:

private void button1_Click(object sender, EventArgs e)
{
     panel1.Visible = true;
}

and evertything works.

Maybe place your code here, so I or someone else could help.

勿挽旧人 2024-12-05 23:21:54

我发现了问题:
有一个事件处理程序绑定到 Visible_Changed-Event 并造成问题。

I have found the Problem:
There was a Eventhandler which was bound to the Visible_Changed-Event and make the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文