c #statustrip消失了 [英] c# statustrip disappears

查看:120
本文介绍了c #statustrip消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用c#创建了一个winform应用程序,并且有一个显示底部时间的状态条。我还在状态栏的顶部有一个复选框。



当用户点击将复选框状态设置为选中时,窗口将重新调整大小为用户显示一组高级选项。发生此事件时,状态条(停靠在底部应重新绘制扩展面板下方的位置。

问题是当我调试应用程序时,状态条最初可见但是我点击状态栏消失的复选框。当我点击应用程序外的任何地方,然后再次点击当前的应用程序时,状态条已被重新绘制,现在可见。我尝试使用我的代码重新绘制每个状态栏单击复选框的时间,但仍然无法解决我的问题。



I have created a winform application using c# and have a status strip which displays the time at the bottom. I also have a check-box right on top of the status strip.

When a user clicks to set the check box status to checked, the windows form re-sizes to display a set of advanced options for the user. When this event occurs, the status strip (which is docked to the bottom should redraw itself a location below the expanded panel.
The problem is that the status strip is initially visible when I debug the application but when I click on the check box the status strip disappears. When I click anywhere outside the application and then click on the current application again the status strip has been re-drawn and is now visible. I tried using my code to redraw the status bar each time the check-box is clicked but still did not help my issue.

if (checkBoxAdvProperties.Checked)
           {
               statusStrip1.Location = new Point(3, 704);
               statusStrip1.Dock = DockStyle.Bottom;               
               statusStrip1.Show();
               statusStrip1.Visible = true;
               this.ClientSize = new System.Drawing.Size(1037, 755);

               //I tried this as well
               //StatusStrip newStatusStrip = new StatusStrip();
               //newStatusStrip .Location = new Point(3, 704);
               //newStatusStrip .Dock = DockStyle.Bottom;  
               //newStatusStrip.Items.AddRange(new                        System.Windows.Forms.ToolStripItem[] {this.toolStripStatusLabel1,this.toolStripStatusLabel2});
               //newStatusStrip .Show();
           }


推荐答案





我认为这只是一个绘画问题。



Hi,

I think this is just a painting problem.

if (checkBoxAdvProperties.Checked)
           {
               statusStrip1.Location = new Point(3, 704);
               statusStrip1.Dock = DockStyle.Bottom;
               statusStrip1.Show();
               statusStrip1.Visible = true;
               this.ClientSize = new System.Drawing.Size(1037, 755);
this.Refresh();
}


这篇关于c #statustrip消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆