Windows Develop Bookmark and Share   
 index > Windows Forms General > Possible Bug of the TableLayoutPanel?
 

Possible Bug of the TableLayoutPanel?

Try this to duplicate the possible bug:

1. Drag a tablelayoutpanel on a form inside the VS 2005IDE.
2. Make it two rows and two columns.
3. Put a textbox in the seond column on the seond row
4.Setthe textbox'scolumnspan = 2.

Since the default growbehavior of the tablelayoutpanel is to add rows, our textbox will now move to the newly-added row to occupy two columns. Everything is fine, right? But wait, we cannot drag our textbox toanywhere any more. No matter how hard you try, the textbox will stay in the newly-added row. This behavior seems not right to me. Is this by design? Could you please check this out, Martin?

Alan

LearnToRock  Tuesday, February 21, 2006 2:57 AM

Anyone can confirm this, or just me?

Thanks,
Alan

LearnToRock  Tuesday, February 21, 2006 4:41 PM

The problem seems caused by the follwing insertion of rowstyles. When a new row was added, only a new row style was added, makie the total rowstyles to 3. Whilethe total row count still the same as before adding a new row, that's 2.

this.tableLayoutPanel1.RowCount = 2; //Still two rows!!!!

this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 74F));

this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F));

this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); //A new rowstyle was added.

My problem is hosting this tableLayoutPanel on the custom designer. Seems I cannot hook up the on controladded event to change the rowcount. How should I approach this issue, please kindly advise.

Thanks for your time and expertise.

Alan

LearnToRock  Tuesday, February 21, 2006 5:12 PM

You can use google to search for other answers

Custom Search

More Threads

• Webbrowser problem with body.innerhtml
• coloring row in datagrid
• freeze the window
• Child Controls on separate threads
• Position of Insertion Point for Selection
• Running an external program inside another form
• Position label in pictureBox
• c# ooc problem
• splitcontainer.splitterdistance not saving, changes
• C# Window label Text