Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrollbar in UserControl in C#

I have create a UserControl added in TabPage.

Tabpage.AutoScroll = true; 

After launching an application ,there is only Vertical scrollbar. When I resize the application horizontally ther is no scroll bar.

Tabcontrol-> TabPage -> UserControl

enter image description here

enter image description here

        // tabPage
        // 
        this.tab_resume_new.Controls.Add(this.userControlResume);
        this.tab_resume_new.Location = new System.Drawing.Point(4, 29);
        this.tab_resume_new.Name = "tabPage";
        this.tab_resume_new.Size = new System.Drawing.Size(1270, 635);

In UserControl

 // UserControl
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoScroll = true;
            this.Controls.Add(this.tableLayoutPanel8);
            this.Name = "UserControlResume";
            this.Size = new System.Drawing.Size(1260, 625)
like image 562
GameBuilder Avatar asked Mar 10 '14 09:03

GameBuilder


1 Answers

There are usually just a few things that can go wrong in this situation.

1) you need to put AutoScroll on your UserControl

2) The control on your tablPage has the Anchor set to Right.. If you have Right then the horizontal scrollbar will not be shown.

3) You have nested control and the wrapper control that is in the tabPage. That wrapper control is not exceeding the tab page bounds.

like image 186
Archlight Avatar answered Oct 13 '22 22:10

Archlight