Row Autosize property not working of Table Layout?

前端 未结 2 372
温柔的废话
温柔的废话 2021-01-29 05:32

I am working on a windows application, in which i am using a table layout panel, in this table layout i have created 5 rows and that is autosize, now dynamically i am adding 4 r

相关标签:
2条回答
  • 2021-01-29 06:25

    I realise this is an old question, however:

    1. Set the dock style of each RadioButton to DockStyle.None
    2. Set AutoSize = True for each RadioButton.

    Autosize won't work if you have a dock style set. Make sure you the above is true for each child control on the table.

    0 讨论(0)
  • 2021-01-29 06:34

    Try setting the radio buttons autosize property to true.

    And remember that a control in a TableLayoutPanel cell always shrinks to fit in the cell until its MinimumSize is reached.

    P.S. You could also try setting the AutoSizeMode property to GrowOnly.

    See MSDN for more info

    EDIT: try this...

    .RowStyles.Clear();
    .RowStyles.Add(new RowStyle(SizeType.AutoSize));
    
    0 讨论(0)
提交回复
热议问题