Windows Develop Bookmark and Share   
 index > Windows Forms General > BUG - Controls Disapear
 

BUG - Controls Disapear

In a C# project with VS 2005 pro,

I have a TabControl with 5 TabPages. From that, in the 3rd TabPages and 4th TabPages I have a TableLayoutPanel which contain a ToolStrip in the upper panel and a ListView set at Details in the lower panel. After a Build with a DEBUG system configuration, the TableLayoutPanel with its controls from the 4th TabPage just disapear from the Designer View. The controls still exists in Source Code and work fine when I execute the code (the controls exists and work well).

What is annoying is that I must rely on the Source Code only and can't use the Designer View anymore to set my controls.

Anyone is aware of this bug ?


GM
GM23  Tuesday, January 24, 2006 7:29 PM
Ok.. From the Source Code, here's the intial position of the TableLayout control :

this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5.295316F));
this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 94.70468F));
this.Dwn_TableLayout_Base.Size = new System.Drawing.Size(794, 491);


I changed the 5.295316F to 6F,

this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6F));
this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 94.70468F));
this.Dwn_TableLayout_Base.Size = new System.Drawing.Size(794, 491);

And all my controls returns to the Designer View. It solve th eproblem.

Conclusion:
Drawing a container control in the Designer View produce odd "float" coordinates that can cause the Designer View to not showing correctly all controls (in this case a TableLayout control). By changing one value to another (in this case 5.295316F to 6F) will correct the bug.
GM23  Tuesday, January 24, 2006 9:04 PM

Hi!

I seen a lot alike in VS.NET 2003. Controls may jump somewhere away from form and so on. Mostly it happens because of invalid source code while opening designer (it works fine with correct C# syntax only). And sometimes it even tries to delete my controls.

In 2005 I not seen things like this yet, but notice that in designer ToolStip hidden buttons visible only when strip focused, it makes a little confusion.

Another problem with designer I seen in 2005 is when you have binding navigator and name some button on it DeleteItem (just like navigator's property). All compiled and started and worked. But next time I open designer - it fails to open.

All I can suggest here isto check in source code coordinates of this controls. Perhabs they are offscreen?

Sergey Galich  Tuesday, January 24, 2006 7:43 PM
More details..

It happen again. With the same project, from the second TabPage, I used the Collection properties in the View Designer to add 2 columns in the ListView control. When I Build the project, the TableLayout, ToolStrip and ListView controls disapear from the Designer View, just like the first time.

It seems that the problem is with the ListView controls set in Details view and on which we add columns from the Designer.

The coordinates are set to "Dock Fill". and will dynamically set themselves on the TabPage control.


GM
GM23  Tuesday, January 24, 2006 8:46 PM
Ok.. From the Source Code, here's the intial position of the TableLayout control :

this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5.295316F));
this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 94.70468F));
this.Dwn_TableLayout_Base.Size = new System.Drawing.Size(794, 491);


I changed the 5.295316F to 6F,

this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6F));
this.Dwn_TableLayout_Base.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 94.70468F));
this.Dwn_TableLayout_Base.Size = new System.Drawing.Size(794, 491);

And all my controls returns to the Designer View. It solve th eproblem.

Conclusion:
Drawing a container control in the Designer View produce odd "float" coordinates that can cause the Designer View to not showing correctly all controls (in this case a TableLayout control). By changing one value to another (in this case 5.295316F to 6F) will correct the bug.
GM23  Tuesday, January 24, 2006 9:04 PM

You can use google to search for other answers

Custom Search

More Threads

• ToolStripComboBox Theming
• Read-only multi-line texbox refresh problem
• Simple question, delete a bitmap.
• Bootable Framework
• RTB picture with extra information
• How to make buttons, controls look like Vista?
• FTP/Wininet issue...Help!
• Drag and Drop
• Tricky button!
• How to select the root node?