List box Navigation buttons

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • D Lutheran

    List box Navigation buttons

    I need to write some code in some navigation buttons to have the button
    move up and down list box items.

    I think I need to start with having the button change an index

    the buttons are previous, next and update. where previous would move
    the cursor up the list one, next would move the cursor down the list
    one and update would change the string that is in the current cursor
    position in the list box

    the data information is coming from three text boxes on a form.

    ANy help would be appreciated.
    Donna

  • D Lutheran

    #2
    Re: List box Navigation buttons

    D Lutheran wrote:
    I need to write some code in some navigation buttons to have the button
    move up and down list box items.
    >
    I think I need to start with having the button change an index
    >
    the buttons are previous, next and update. where previous would move
    the cursor up the list one, next would move the cursor down the list
    one and update would change the string that is in the current cursor
    position in the list box
    >
    the data information is coming from three text boxes on a form.
    >
    ANy help would be appreciated.
    Donna

    Just in case anyone else is trying to figure out how to do this, here
    is my code that works.

    ' A button that moves to a previous entry in the list box VB.net 2005

    Private Sub btnPrev_Click(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles btnPrev.Click

    lstGrades.Text = CStr(lstGrades. Items(lstGrades .SelectedIndex -
    1))

    End Sub

    ' a button that moves to the next entry in a list box VB.net 2005

    Private Sub btnNext_Click(B yVal sender As Object, ByVal e As
    System.EventArg s) Handles btnNext.Click

    lstGrades.Text = CStr(lstGrades. Items(lstGrades .SelectedIndex +
    1))

    End Sub

    I'm still trying to figure out this one ' button update a entry in the
    list box.

    Private Sub btnUpdate_Click (ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles btnUpdate.Click


    End Sub

    Keep in mind that the text might wrap from the posting and if you need
    the above code, if it doesn't fit on one line, make sure you use a
    space and an underscore.

    Comment

    Working...