By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

List box Navigation buttons

P: n/a
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

Nov 5 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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(ByVal sender As System.Object, ByVal e As
System.EventArgs) 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(ByVal sender As Object, ByVal e As
System.EventArgs) 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.EventArgs) 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.

Nov 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.