Automatically resize TableLayoutPanel

Posted by Armagan on Stack Overflow See other posts from Stack Overflow or by Armagan
Published on 2009-09-28T13:43:13Z Indexed on 2010/06/01 18:53 UTC
Read the original article Hit count: 320

Filed under:
|
|

I have a programmatically created TableLayoutPanel. It works fine but I couldn't find something: how can I make it size columns automatically when the form is resized? The panel is set to Dock.Top and when I resize the form instead of sizing every column as percents, only last column grows. What can I do for this? Here's how I add ColumnStyle for each column:

this.tablePanelFilter.ColumnStyles.Add(
  new ColumnStyle(SizeType.Percent,Convert.ToSingle(
     Math.Ceiling((decimal)100 / (decimal)columnCount))));

© Stack Overflow or respective owner

Related posts about .NET

Related posts about winforms