Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Menuitems disappear from Menustrip after window-minimize/maximize
 

Menuitems disappear from Menustrip after window-minimize/maximize

Hi All,

i placed a toolstrippanel with a menustrip and 2 toolstrips
into my form and
when the application starts, all menuitems are visible.

after minimizing and maximizing the window again,
only the grid of the menu is visible, the menuitems
have all disappeared. but the toolstrips with buttonsare still ok.

(the menu is noth stretched from one end to the other, it is in the same line as the toolstrips)

does anyone know a reason for that behavior ?

thanks

j.

joe lion  Tuesday, August 21, 2007 6:53 AM

What do you mean by "toolstrippanel"? There's no such control. Could you provide detail steps to reproduce this problem?

Zhi-Xin Ye  Monday, August 27, 2007 1:01 PM
I've currently got similar behaviour; when a window is minimised and then redisplayed, two buttons do not reappear - they in effect disappear. They only disappear on minimisation - if the window is burried beneath other windows and then revealed, the buttons do not disappear.

What's significant about these two buttons is that they are part of a custom control. The other subcontrol (a TreeView) within the custom control does get rendered when the window is redisplayed after minimisation, but these buttons don't. The custom control extendsUserControl; it does not have any custom display code, as its entire user interface comprises the tree view and the two buttons. The user interface for the custom control was built in Visual Studio 2008 design view.

The entire code relating to these two buttons in the 'Designer' file is as follows:

//
// ruleDeleteButton
//
this.ruleDeleteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ruleDeleteButton.Location = new System.Drawing.Point(112, 335);
this.ruleDeleteButton.Name = "ruleDeleteButton";
this.ruleDeleteButton.Size = new System.Drawing.Size(75, 23);
this.ruleDeleteButton.TabIndex = 12;
this.ruleDeleteButton.Text = "Delete";
this.ruleDeleteButton.UseVisualStyleBackColor = true;
this.ruleDeleteButton.Click += new System.EventHandler(this.ruleDeleteButton_Click);
//
// ruleImportButton
//
this.ruleImportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ruleImportButton.Location = new System.Drawing.Point(193, 335);
this.ruleImportButton.Name = "ruleImportButton";
this.ruleImportButton.Size = new System.Drawing.Size(75, 23);
this.ruleImportButton.TabIndex = 13;
this.ruleImportButton.Text = "Import";
this.ruleImportButton.UseVisualStyleBackColor = true;
this.ruleImportButton.Click += new System.EventHandler(this.ruleImportButton_Click);

The VisibleChanged event of the custom control does not fire when the window is minimised and then redisplayed, so cannot be intercepted/handled. The Paint event does fire, but so far I have not managed to do anything in the Paint event handler which will cause these buttons to be rendered.

Any thoughts or solutions warmly welcomed.
Simon Brooke  Tuesday, October 21, 2008 2:55 PM
Hi Simon

We are facing a similoar issue , could you solve your problem?
Akshay S Bhatnagar  Friday, April 24, 2009 8:45 AM

You can use google to search for other answers

Custom Search

More Threads

• MenuStrip lost collection
• Status Strip Blacking Out Issue on Windows Vista
• Tips for creating a modern gui
• Treeview adding nodes problem in Framework 2
• Showing blank textbox for int and double datatype properties in propertygrid
• time on a form
• Retrieving Form Reference from Component
• transparent label?
• Global DataSet - or Sharing Data between Forms
• Is there a reason tooltips <-> controls is more than one-to-one?