Results 1 to 3 of 3

Thread: vb6 ListView click/ lostfocus bug

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202

    vb6 ListView click/ lostfocus bug

    Anyone know how to fix this bug?
    when the user clicks on a ListView (reportmode), I make an Textbox visible and SetFocus to it.
    (The TextBox.GotFocus / LostFocus sets/ resets the backcolor of the textbox.)

    Very quickly the Textbox gets & loses focus back to the Listview. (although the Textbox still has focus, as you can enter text into)
    This problem occurs in my of programs...
    listview V6.0, SP6

  2. #2
    Lively Member
    Join Date
    Jan 2020
    Posts
    120

    Re: vb6 ListView click/ lostfocus bug

    You can try in MouseUp event.

    HTML Code:
    Private Sub lvlcheckin_MouseUp(sender As Object, e As MouseEventArgs) Handles lvlcheckin.MouseUp
        If e.Button = Windows.Forms.MouseButtons.Left Then
    
            If lvlcheckin.FocusedItem.Selected = True Then
                lvlcheckin.FullRowSelect = True
            Else
                lvlcheckin.FullRowSelect = False
            End If
        End If
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202

    Re: vb6 ListView click/ lostfocus bug

    hi prahald
    i put the textbox.setfocus in the listbox mouseup event. this fixed the problem..

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