Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Aug 2008
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set cursor in combobox (VB6)

    Hi all. I've got a problem with a combobox there are suggesting lines from a list, based on the letters typed. Sometimes the cursor jumpes to the end on the 3-4 typing, so the rest of the word are typed after the suggested word. How do I control the cursor in this combobox? In newer VB one can get the cursor object but how does VB6 work ?

    The suggedtion are made like this:
    Dim Res As Long
    Dim lLen As Long
    Dim OrgIndex As Long

    With m_Combo
    OrgIndex = m_Combo.ListIndex
    Res = SendMessage(.hWnd, CB_FINDSTRING, -1, ByVal .Text)
    If Res >= 0 Then
    Call SendMessage(.hWnd, WM_SETREDRAW, False, 0&)
    lLen = Len(.Text)
    .ListIndex = Res
    .Text = .List(Res)
    .SelStart = lLen
    .SelLength = Len(.Text) - lLen
    Call SendMessage(.hWnd, WM_SETREDRAW, True, 0&)
    End If
    End With

    /Søren

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Set cursor in combobox (VB6)

    I apologize for the lack of replies. Woody's Lounge focuses more on VBA than on VB6. You may have a better chance of a reply in one of the VB6 newsgroups.

  3. #3
    New Lounger
    Join Date
    Aug 2008
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set cursor in combobox (VB6)

    Hi Hans, no reply is also an reply. In this case it seems that I'm working with a wrong design.. Therefore I have rewritten the whole method and solved it in an other way.
    /Søren

Posting Permissions

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