Thread: Scrollbars c#

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    29
    Rep Power
    0

    Scrollbars c#


    Hi folks.

    I have a panel with scrollbars containing an image 8000 pixels wide. Setting max to 8000 does not allow me to scroll to the right hand edge - basically it stops short. I have read that the HorizontalScroll max should be set to Size of the image plus largeChange but when I do this
    Code:
                // LargeChange is typically one page.
                int largeChangeHorizontal = panelMainMapScroller.Width;
    
                int maxHorizontal = panelMainMap.Width + largeChangeHorizontal;
    
                // SmallChange it typically 1%.
                int smallChangeHorizontal = Math.Max((int)(maxHorizontal / 100), 1);
    
                panelMainMapScroller.HorizontalScroll.Minimum = 0;
                panelMainMapScroller.HorizontalScroll.Maximum = maxHorizontal;
    Maximum is not increased and still set at = 7999

    Is there a criteria for allowing maximum to be reset?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    29
    Rep Power
    0
    Actually this was a red herring - I have not been able to scroll to the limit of the image because the image was being truncated.

    Code:
    panelMainMap.Width = bitmapMainMap.Width;
    This line caused the problem I thought I needed to resize the inner panel to accomodate the graphic prior to painting but commenting this out in fact corrects things.

    Confused from Notts!

IMN logo majestic logo threadwatch logo seochat tools logo