Solved

TableLayoutPanel horizental scroll bar

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

717 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