Click here to Skip to main content
13,458,661 members
Rate this:
Please Sign up or sign in to vote.
See more:
actual problem in tablelayoutpanel is as below
In TableLayoutPanel if Dock = Fill and AutoSize = true then last column occupy all remaining space
so, last column is wide than other columns of tablelayoutpanel. I want all columns with same size
I have refer a solution but can't understand
link is[^]
now, i add an extra column and want to invisible it
but no direct property is available,
I have tried to make width of column zero but, still it shows the column
please help if you have some idea about this.
Posted 14-Aug-12 3:34am
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

It's an old thread, but may help someone else.
This can be easily achieved:

tableLayout1.ColumnStyles[4].SizeType = SizeType.Absolute;
tableLayout1.ColumnStyles[4].Width = 0;

Dave Kreskowiak 6-Aug-14 8:38am
You forgot to mention a side-effect of your solution. If there are other rows/columns with percentage heights/widths, you're changing the layout of the entire TLP and all controls will move/grow/shrink (depending on docking) to take up the space. This may not have a desired effect.
Member 10352522 6-Aug-14 8:49am
You're right, I've tested without anchor nor docking, and all the columns with percentage widths. The other colums recalculate automatically to fill the space, and the controls inside get centered correctly.
this is OK for me.
Dave Kreskowiak 6-Aug-14 12:39pm
All I said is that may not be a desired effect for other users.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There are no actual rows and columns in a tablelayoutpanel. TLP is an extension to existing controls to control where the control paints itself. You cannot hide a row or column in the TLP.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180323.1 | Last Updated 6 Aug 2014
Copyright © CodeProject, 1999-2018
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