Solved

VB6 - Listbox with checked items

Posted on 2013-05-17
1
501 Views
Last Modified: 2013-05-17
Hi guys,

I have a listbox with property style=1 (checked boxes), the problem is when i read it in a loop, it reads the selected ones instead of the checked ones.

Is the any way to read only the checked ones?

Thank you in advance,

CODE:

Private Sub cmdCalculadora_Click()
    Dim i As Long
    Dim nInv As Integer
 
    For i = 0 To lstCriterios.ListCount - 1
        If lstCriterios.Selected(i) = True Then
            If Right(lstCriterios.Text, 1) <> "*" Then
                nInv = Right(lstCriterios.Text, 3)
                npNumerodeInvitados = (npNumerodeInvitados + nInv)
            End If
            npNumerodeSeleccionados = (npNumerodeSeleccionados + 1)
        End If
    Next i
   
    npNumerodeSeleccionadosMasInvitados = (npNumerodeSeleccionados + npNumerodeInvitados)
    txtSeleccionados.Text = npNumerodeSeleccionados
    txtInvitados.Text = npNumerodeInvitados
    txtSeleccionadosMasInvitados.Text = npNumerodeSeleccionadosMasInvitados
End Sub
0
Comment
Question by:elm9999
1 Comment
 

Accepted Solution

by:
elm9999 earned 0 total points
ID: 39176077
Alredy done by myself.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mysql vs Oracle 10 134
Problem to With line 4 37
fso.FolderExists("\\server\HiddenFolder$") 4 46
MS Access 03, TransferText, decimal places 8 37
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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

930 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

10 Experts available now in Live!

Get 1:1 Help Now