Results 1 to 5 of 5

Thread: [RESOLVED] Panel Autoscroll will not show vertical scroll bar

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2011
    Posts
    20

    Resolved [RESOLVED] Panel Autoscroll will not show vertical scroll bar

    Ok. I have a panel with a TableLayoutPanel enclosed in it. I am loading several command buttons into it (one in each grid box). I have the panel set to autoscroll. When TableLayoutPanel is set to AddColumns, all works well. However, I dont want horizontal scroll, I want vertical. When I set TableLayoutPanel to AddRows, a vertical scrollbar will not appear. I have searched everywhere and cannot find a solution. Any ideas?

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Panel Autoscroll will not show vertical scroll bar

    Does your content's size actually merit a vertical scroll bar? How are the row styles set, i.e. AutoSize, Absolute, or Percent?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2011
    Posts
    20

    Re: Panel Autoscroll will not show vertical scroll bar

    The RowSize and ColumnSize are Absolute. 50 and 100 respectively. There are 8 rows and 5 columns. For a total of 40 items under normal load. However, I load 80 items exactly in this example. Autosize is on and the TableLayoutPanel has its grow mode to AddRows.. It is well warranted I believe.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2011
    Posts
    20

    Re: Panel Autoscroll will not show vertical scroll bar

    SOLUTON FOUND:
    [code]
    Dim intWidth As Integer
    Dim intHeight As Integer

    intHeight = TableLayoutPanel.Height
    intWidth = TableLayoutPanel.Width

    TableLayoutPanel.Dock = Top
    TableLayoutPanel.Autosize = True

    Panel.MaximumSize.Width = intWidth
    Panel.MaximumSize.Height = intHeight
    Panel.AutoScroll = True
    [Code]

    Of course all this can be set from the designer, but using code was good practice.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2011
    Posts
    20

    Re: Panel Autoscroll will not show vertical scroll bar

    SOLUTON FOUND:
    Code:
    Dim intWidth As Integer
    Dim intHeight As Integer
    
    intHeight = TableLayoutPanel.Height
    intWidth = TableLayoutPanel.Width
    
    TableLayoutPanel.Dock = Top
    TableLayoutPanel.Autosize = True
    
    Panel.MaximumSize.Width = intWidth
    Panel.MaximumSize.Height = intHeight
    Panel.AutoScroll = True
    Of course all this can be set from the designer, but using code was good practice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width