Results 1 to 3 of 3

Thread: Recorrer con For en ListView

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2021
    Posts
    1

    Recorrer con For en ListView

    Estimados Soy nuevo en la programación con el control listview, he actualizado mi listbox y tengo el siguiente problema
    CODIGO QUE TENIA EN EL LISBOX
    with Listbox1
    For i = 0 To Me.ListBox1.ListCount - 1
    If .ListCount = .ListIndex + 1 Then: Exit Sub
    .ListIndex = .ListIndex + 1
    Call PASAR_DATOS_CREDENCIAL
    Call CREAR_CREDENCIAL
    Next i
    end with

    CODIGO ACTUAL: EL CUAL ME DA ERROR DICE: "error 383 property is read-only"
    With Me.LTV_REGISTRO
    If Answer = vbYes Then
    For i = 1 To Me.LTV_REGISTRO.ListItems.Count

    If .ListItems.Count = .ListItems.Item(i).Index + 1 Then: Exit Sub
    .ListItems.Item(i).Index = .ListItems.Item(i).Index + 1

    Call PASAR_DATOS_CREDENCIAL
    Call CREAR_CREDENCIAL_PDF
    Next i



    End If
    End With


    si alguien pudiera ayudarme con esto.. por favor

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,399

    Re: Recorrer con For en ListView

    Translation:

    Dear I am new to programming with the listview control, I have updated my listbox and I have the following problem
    CODE I HAD IN THE LISBOX
    if someone could help me with this .. please

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Recorrer con For en ListView

    even with the translation, this is pretty had to understand

    on which line does the error occur?, what is the value of i and the value of .listitems.count
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width