TableLayoutPanel horizental scroll bar

In my winform app. I create on line a TableLayoutPanel , I add controls to the TableLayoutPanel, and then add the full TableLayoutPanel  to a panel control.
My problem is that when there is need for vertical scrool bar, the  horizental scroll bar is apearing eith no need.
How can I solve this?
Control ctrlToAddTo = this.panelOfObjects;
            TableLayoutPanel tlp = new TableLayoutPanel();            
                     tlp.CellBorderStyle = TableLayoutPanelCellBorderStyle.None;            
                     tlp.Width = this.Width-10;
           tlp.Height = this.Height;
                      tlp.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
                      tlp.Padding = new Padding(0, 0, 0, 0);
            foreach (PictureBox pb in listOfPb)            
            tlp.ColumnCount = (ctrlToAddTo.Width - 60) / (tlp.Controls[0].Width);
            ctrlToAddTo.Width = (tlp.Controls[0].Width) * tlp.ColumnCount + 60;
            tlp.Width = ctrlToAddTo.Width;
            tlp.Height = ctrlToAddTo.Height;
            tlp.AutoScroll = true;            

Open in new window

Who is Participating?

Improve company productivity with a Business Account.Sign Up

puru1981Connect With a Mentor Commented:
you can use HScroll property to set the visibility

In wich browser is this? Is hope your site is not made with frames?? This behavior is mostly with framesets.
Sorry it is C#, in my head i was buzy with HTML...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.