none
Panel scrollbar setting RRS feed

  • Question

  • Hi,

    I have a picturebox in a panelbox so that if the picturebox gets larger I want the scrollbars to appear which they do.  The problem is after I finish putting in my graphics into the picturebox the picturebox is resized properly but the top left corner of the picturebox is viewed whereas I would rather have the scrollbar set so the viewer sees the bottom most portion of the picturebox.  I have tried setting

    Form2.Panel1.VerticalScroll.Value = 100 but this still does not set the scrollbar to the very bottom of the page.

    Thanks

    Les

    Saturday, September 22, 2018 7:50 PM

Answers

  • Hi

    Try

      Panel1.AutoScroll = True
      Panel1.AutoScrollPosition = New Point(Panel1.Left, Panel1.Bottom)


    Regards Les, Livingston, Scotland

    • Proposed as answer by IronRazerz Sunday, September 23, 2018 10:26 PM
    • Marked as answer by Les2011 Monday, September 24, 2018 5:58 PM
    Sunday, September 23, 2018 10:08 AM
  • Hi,

    try the code:

            Panel1.AutoScroll = True
            Panel1.VerticalScroll.Value = Panel1.VerticalScroll.Maximum
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Les2011 Monday, September 24, 2018 5:58 PM
    Monday, September 24, 2018 3:04 AM

All replies

  • Hi

    One possibility.

    Put the PB into a Panel1, set;

        Panel1.AutoScroll = True
        Panel1.AutoScrollPosition = New Point(Panel1.Right, Panel1.Bottom)



    Regards Les, Livingston, Scotland


    • Edited by leshay Saturday, September 22, 2018 8:18 PM
    • Marked as answer by Les2011 Sunday, September 23, 2018 3:22 AM
    • Unmarked as answer by Les2011 Sunday, September 23, 2018 3:48 AM
    Saturday, September 22, 2018 8:17 PM
  • Hi Leshay,

    I tried your idea and it did what I wanted it to do.  I already had the picturebox inside of the panel box so that part I did right. Now let me see if I understand your code snippet <S>.  With Panel1.AutoScrollPosition = New Point(Panel1.Right, Panel1.Bottom) you are sending a point to the bottom right corner of the panelbox???  If so then if I want to do the opposite would I just do Panel1.AutoScrollPosition = New Point(Panel1.left, Panel1.top)?

    Thanks Leshay

    Les

    Sunday, September 23, 2018 1:01 AM
  • Hi Les,

    After looking at the effect your code provides I initially said it did the trick but that's not totally correct.  What I appear to need is a way of pushing the image to the bottom like you said but I need it to go to the left most position.  With your code snippet it sends the scroll to the very bottom but it also sends the image all the way to the right thus not allowing the user to see the left most side without having to scroll.

    Thanks

    Les

    Sunday, September 23, 2018 3:51 AM
  • Hi

    Try

      Panel1.AutoScroll = True
      Panel1.AutoScrollPosition = New Point(Panel1.Left, Panel1.Bottom)


    Regards Les, Livingston, Scotland

    • Proposed as answer by IronRazerz Sunday, September 23, 2018 10:26 PM
    • Marked as answer by Les2011 Monday, September 24, 2018 5:58 PM
    Sunday, September 23, 2018 10:08 AM
  • Hi,

    try the code:

            Panel1.AutoScroll = True
            Panel1.VerticalScroll.Value = Panel1.VerticalScroll.Maximum
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Les2011 Monday, September 24, 2018 5:58 PM
    Monday, September 24, 2018 3:04 AM
  • Hi Alex,

    Looks like this works also.

    Many thanks

    Les

    Monday, September 24, 2018 5:57 PM
  • Hi Les,

    Looks like this works also.

    Many thanks

    Les

    • Marked as answer by Les2011 Monday, September 24, 2018 5:58 PM
    • Unmarked as answer by Les2011 Monday, September 24, 2018 5:58 PM
    Monday, September 24, 2018 5:58 PM