Solved

TableLayoutPanel horizental scroll bar

Posted on 2010-09-02
3
820 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows shortcut location resolution on double click open 4 53
Exception when using Alea null reference in fsharp.core.dll 3 53
Return array 3 20
Need help with a query 14 39
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 article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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