Solved

VB6 - Listbox with checked items

Posted on 2013-05-17
1
504 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

821 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