Solved

TableLayoutPanel horizental scroll bar

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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