Solved

VB6 - Listbox with checked items

Posted on 2013-05-17
1
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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