How to fix scrollbars when the window or container is resized?

前端 未结 2 1590
遥遥无期
遥遥无期 2020-12-21 08:54

Currently in my application I am using the HScrollBar and VScrollBar for panning around in a large image. The part of the image that is shown is based on the scrollbar\'s Va

相关标签:
2条回答
  • 2020-12-21 09:10

    Use something like this:

    HScrollBarObject.SetStyle(ControlStyles.ResizeRedraw, true);
    
    0 讨论(0)
  • 2020-12-21 09:33

    Try calling the scrollbar's Invalidate() method in the form's resize event handler:
    http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invalidate.aspx

    That should cause it to redraw correctly after the form is resized.

    0 讨论(0)
提交回复
热议问题