How to add scrollbars in picturebox ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DeathFrag
    New Member
    • Feb 2008
    • 12

    How to add scrollbars in picturebox ??

    I've been trying with failure to add scrollbars( both vertical and horizontal) to my picturebox.
    Am coding in C#.NET and i need some help on how to add scrollbars. The situation is that i load an image at runtime into the picturebox, but when the image size exceeds the form size i cant see the whole image and so i want to add scrollbars if the image size exceeds 800x600 at runtime.

    Please help me,
    Thanking you all in advance

    Waiting in anticipation... .
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Add a panel object, assign it a max size and give it scrollbars.
    Then place your picturebox inside it and set it to "Dock-all" (I think dock-all is right anot anchoring all 4 sides to the panel)
    There might have to be a few extra lines of code when you assign a picture to the picturebox, to make sure the panel resizes correctly, but it will give you your scrollbars.

    Comment

    Working...