TableLayoutPanel sizing

前端 未结 3 1789
野趣味
野趣味 2021-01-04 11:41

I may not be using the right control for what I want. I\'m filling a table with controls and I want each column to automatically size to the controls contained within it. Fo

3条回答
  •  没有蜡笔的小新
    2021-01-04 12:37

    You'll need to handle the ControlAdded event, then resize the column if the new control's width is greater than the column's width...

    You say you don't want to fiddle with measuring, but if you're resizing, you kind of have to. Fonts and such shouldn't come into it if you're careful about the TextAlign of your checkboxes etc...

提交回复
热议问题