Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to move scroll bar thumb on click of button.

How to move scroll bar thumb on click of button.

Scheduled Pinned Locked Moved C#
comtutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chintan Desai
    wrote on last edited by
    #1

    Hi guys, I have one panel and one picturebox in panel.Here picturebox exceed panel height.Now, I wanna to move scroll thumb downward on click of button to let user see the other areas of picturebox. I have written one code in button_click event panel1.VerticallScroll.Value+=5;//5 indicate moving thumb by 5 pixel. I am getting some awkward output.In first click I can move picturebox top by 5,in second click verticall scroll bar get incremented by 5,in 3rd I can move picturebox top by 5,in 4th click verticall scroll bar get incremented by 5. can any one tell me why it so...I want both to be done in one click. pls reply thanks in advance.

    Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)

    A 1 Reply Last reply
    0
    • C Chintan Desai

      Hi guys, I have one panel and one picturebox in panel.Here picturebox exceed panel height.Now, I wanna to move scroll thumb downward on click of button to let user see the other areas of picturebox. I have written one code in button_click event panel1.VerticallScroll.Value+=5;//5 indicate moving thumb by 5 pixel. I am getting some awkward output.In first click I can move picturebox top by 5,in second click verticall scroll bar get incremented by 5,in 3rd I can move picturebox top by 5,in 4th click verticall scroll bar get incremented by 5. can any one tell me why it so...I want both to be done in one click. pls reply thanks in advance.

      Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      Try adding panel1.Refresh(); to update it after you change the scroll bar, it might help.

      My current favourite word is: Bauble!

      -SK Genius

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups