473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Nov 5 '06 #1
1 2665
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Neville | last post by:
I am having some trouble with some old code revolving around custom form navigation buttons. My main form has a sub-form with these custom navigation buttons. In other words, the code should be...
3
by: Jack Russell | last post by:
I want to add navigation buttons to a tabcontrol (somewhat like excel) How do I get the "tabs" to offset to the right so that I can draw the buttons on the left? TIA -- Remove norubbish to...
4
by: Jamey Shuemaker | last post by:
Howdy, Saw a couple threads from the past few years on this topic, but didn't really find any solutions. Here's one I found:...
4
by: =?ISO-8859-1?Q?Fran=E7ois_de_Dardel?= | last post by:
Here is the page: http://dardel.info/museum/Museum1.html and here is the CSS (see navigation buttons at bottom of file): http://dardel.info/museum/style3.css Is there a way to make all nav...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.