Results 1 to 6 of 6

Thread: EnsureVisible in ListView

Hybrid View

  1. #1
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: EnsureVisible in ListView

    fafalone.... um... that may work... but I don't think that is what's needed...

    pinguinito -- you need to set the selected item to the new item, then make the ITEM ensurevisible....
    against my better judgement.... like this:

    Code:
    Set objItem = LV_Cliente.ListItems.Add(, , rs(0))
    objItem.SubItems(1) = rs!name
    objItem.SubItems(2) = rs!age
    objItem.SubItems(3) = rs!address
    objItem.EnsureVisible
    objItem.Selected = True
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    7

    Re: EnsureVisible in ListView

    Not working,
    Last edited by pinguinito; Feb 10th, 2012 at 09:13 AM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    7

    Re: EnsureVisible in ListView

    I upload the code to see if anyone can help

    thank you very much
    Attached Files Attached Files

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    7

    Resolved Re: EnsureVisible in ListView

    Public IdCliente
    Dim i As Integer
    Private Sub cmdSave_Click()

    On Error GoTo ErrorSub

    cnn.Execute "UPDATE cliente set name = '" & Trim(Text1(1)) & _
    "', age = '" & Trim(Text1(2)) & _
    "', address = '" & Trim(Text1(3)) & _
    "' where id_cliente = " & IdCliente & ""

    With Form1
    .LV_Cliente.SelectedItem.EnsureVisible
    For i = 1 To 3
    .LV_Cliente.SelectedItem.SubItems(i) = Text1(i)
    Next i
    End With

    DoEvents

    Unload Me
    Set Form2 = Nothing
    Exit Sub
    ErrorSub:
    MsgBox Err.Description

    End Sub
    Last edited by pinguinito; Feb 10th, 2012 at 12:19 PM. Reason: Resolved

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