Solved

TableLayoutPanel horizental scroll bar

Posted on 2010-09-02
3
815 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
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…

911 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