Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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();
           }

		
Posted 13-Jan-13 23:49pm
Edited 14-Jan-13 0:31am
s_mon11.8K
v2
Comments
s_mon at 14-Jan-13 7:04am
   
Have you tried to make a prototype for your problem? Sometimes it helps if you're simplify your application down to the propblem to be solved. In this case, just make an app which contains just the necessary items like the statusstrip and your expendable...
Alan N at 14-Jan-13 9:10am
   
What is displayed where the status strip should be when the problem occurs?
Member 9557085 at 15-Jan-13 4:28am
   
The area where the status strip should be present is the empty, i.e. the background form is visible. I tried to redraw the status bar as well but it did not help.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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();
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100