Solved

List boxes

Posted on 2000-05-11
2
144 Views
Last Modified: 2010-05-02
Hi,

I have a list box full if items. I want to have a button that will add a number to each of the items. I.e. the first item is given the number 1, the second 2 and so on. The number given must be added at the beginning.

Cheers

Darude :)
0
Comment
Question by:darude
2 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 50 total points
Comment Utility
Private Sub Command1_Click()
    Dim i As Integer
    For i = 0 To List1.ListCount - 1
        List1.List(i) = (i + 1) & " " & List1.List(i)
    Next
End Sub
0
 
LVL 14

Expert Comment

by:wsh2
Comment Utility
<adding to Azra's very worthy comment>
Yikes.. better hope the List1.Sorted property is False.. <smile>.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now