Solved

VB6 - Listbox with checked items

Posted on 2013-05-17
1
500 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
Comment Utility
Alredy done by myself.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

763 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