Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET WinForm
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 http://stackoverflow.com/questions/2054667/in-tablelayoutpanel-if-dock-fill-and-autosize-true-then-last-column-row-occu[^]
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 4:34am
Rate this: bad
good
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;
 
Cheers.
  Permalink  
Comments
Dave Kreskowiak at 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 at 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 at 6-Aug-14 12:39pm
   
All I said is that may not be a desired effect for other users.
Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 DamithSL 445
1 Maciej Los 238
2 OriginalGriff 229
3 Zoltán Zörgő 190
4 BillWoodruff 120
0 OriginalGriff 7,969
1 DamithSL 6,139
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,309
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 6 Aug 2014
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