MobileDev Fast
MobileDev Fast

Reputation: 63

Unable to enable scroll in tablelayoutpanel in C#

I am using a tablelayout panel in my project and displaying items in it . but it is not scrollable , i have tried with autoscroll, maximum size and everything else that seems related to scrolling .

Any kind of help will be appreciated , many thanks , plz help

Upvotes: 0

Views: 1652

Answers (2)

Itachi
Itachi

Reputation: 6090

I'm not sure what you're designing for that control, but it really implemente the interface IScrollable (just like this name, you could view it in object browser).

Here is mine.

// 
        // 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;
        // 

Hope this could help you, I use it just now.

Upvotes: 1

Luis Filipe
Luis Filipe

Reputation: 8718

In order to auto scroll show any kind of scroll bar its parent control must be smaller than the TableLayoutPanel itself. Check you parent size and other properties, such as autosize, dock and autosizemode

Upvotes: 1

Related Questions