【发布时间】:2023-03-05 05:37:01
【问题描述】:
我想在TableLayoutPanel 中动态添加行,并在 GUI 上的固定区域中。因此,如果记录数量增加,那么我想要一个垂直滚动条来帮助用户查看更多记录。为此,我设置了 PropertyAutoScroll = true; 但它不起作用。
CheckBox c = new CheckBox();
c.Text = "Han";
tableLayoutPanel1.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.AutoSize));
this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.Controls.Add(c, 0, 0);
tableLayoutPanel1.AutoScrollPosition = new Point(0, tableLayoutPanel1.VerticalScroll.Maximum);
this.tableLayoutPanel1.AutoScroll = true;
tableLayoutPanel1.Padding = new Padding(0, 0, SystemInformation.VerticalScrollBarWidth, 0);
【问题讨论】:
标签: c# .net winforms tablelayout