Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scrollbar to control grid within groupbox

Status
Not open for further replies.

Hueby

MIS
Oct 20, 2004
321
US
Hi all,

I have a simple form with a vertically long grid that displays data. I put this grid within a groupbox, and then added a vertical scrollbar. I want the user to use this scrollbar to move up and down the vertical grid.

Currently, when the user clicks down on the scrollbar it moves the grid down, and when you click up, the grid moves up. This is not what I want.. it is working "backwards", and doesn't move enough up or down for the entire grid to show. Could I get some help, or pointed in the right direction?

This is my first attempt at using scrollbars. I am currently using this code:

Code:
 Private Sub VScrollBar1_Scroll(ByVal sender As Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll
        UltraGrid1.Top = VScrollBar1.Value

    End Sub

    Private Sub VScrollBar1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles VScrollBar1.ValueChanged
        UltraGrid1.Top = VScrollBar1.Value
    End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top