小编nin*_*ten的帖子

TableLayoutPanel的Autoscroll属性不起作用

我想TableLayoutPanel在GUI上的固定区域中动态添加行.所以,如果记录数量增加,那么我想要一个垂直滚动条,帮助用户查看更多记录.为此,我设置了Property AutoScroll = 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);
Run Code Online (Sandbox Code Playgroud)

.net c# tablelayout winforms

3
推荐指数
2
解决办法
1万
查看次数

标签 统计

.net ×1

c# ×1

tablelayout ×1

winforms ×1