Solved

TableLayoutPanel horizental scroll bar

Posted on 2010-09-02
3
813 Views
Last Modified: 2012-05-10
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.Controls.Add(pb);

            }

            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;            

            this.panelOfObjects.Controls.Add(tlp);

Open in new window

0
Comment
Question by:yaron89
  • 2
3 Comments
 
LVL 8

Expert Comment

by:dmeeren
ID: 33584287
In wich browser is this? Is hope your site is not made with frames?? This behavior is mostly with framesets.
0
 
LVL 8

Expert Comment

by:dmeeren
ID: 33584289
Sorry it is C#, in my head i was buzy with HTML...
0
 
LVL 9

Accepted Solution

by:
puru1981 earned 500 total points
ID: 33584649
you can use HScroll property to set the visibility

tlp.HScroll=false;
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now