Finding position of horizontal scroll bar VB.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LegalIT
    New Member
    • Feb 2008
    • 15

    Finding position of horizontal scroll bar VB.net

    Hello,

    I have an application that loads a set of database records into memory. I then have buttons to move to the first, next, previous or last record.

    I would like to add a horizontal scroll bar so that the user can skip around; to the middle, towards the end, etc. I'm not sure what event to use to allow a user to move the scroll bar but then capture the value when the mouse button is released. When I try MouseCaptureCha nged it stops the whole time. When I try MouseLeave it doesn't stop until the mouse is moved instead of when the mouse button is released.

    Any suggestions would be greatly appreciated.

    LegalIT
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    In VB6, ScrollBar is programmed like this:
    Set Min and Max Values , In your case, it would be : 0 and RecordCount.
    SmallChange =1, LargeChange=10 (Or Depending on the Data Volume)

    and write the code in Change Evnet of the scroll bar..
    ScrollBar.Value >> gives the position.

    It should be the same in VB.net, I have not checked..

    REgards
    Veena

    Comment

    Working...