February 16th, 2012, 05:14 AM
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
Maximum is not increased and still set at = 7999
// 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;
Is there a criteria for allowing maximum to be reset?
February 16th, 2012, 07:07 AM
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.
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.
panelMainMap.Width = bitmapMainMap.Width;
Confused from Notts!