2012-08-07 111 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; 
     // 

希望這可以幫助你,我剛纔使用它。