2012-08-07 123 views
0

我使用的是tablelayout面板在我的项目,显示在它的项目。但它不是可滚动的,我尝试过使用自动滚动,最大尺寸以及其他所有似乎与滚动相关的内容。无法启用TableLayoutPanel中滚动在C#

任何形式的帮助将不胜感激,千恩万谢,plz帮助

+0

打招呼,因为TableLayoutPanel中是一个滚动的控制可以请您编辑您的代码和propertie自动滚屏设置好的真作品 – 2012-08-07 05:57:53

回答

1

为了自动滚动显示任何滚动条的父控件必须比TableLayoutPanel中本身较小。 检查你父母的大小和其他属性,如自动调整大小,码头和autosizemode

1

我不知道你是什么样的设计为控制,但它确实implemente接口IScrollable(就像这个名字,你可以在对象浏览器中查看它)。

这里是我的。

// 
     // tableLayoutPanel1 
     // 
     this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     | System.Windows.Forms.AnchorStyles.Left))); 
     this.tableLayoutPanel1.AutoScroll = true; 
     this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; 
     this.tableLayoutPanel1.ColumnCount = 2; 
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); 
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); 
     this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12); 
     this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 
     this.tableLayoutPanel1.RowCount = 1; 
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); 
     this.tableLayoutPanel1.Size = new System.Drawing.Size(686, 515); 
     this.tableLayoutPanel1.TabIndex = 0; 
     // 

希望这可以帮助你,我刚才使用它。