CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Posts
    60

    Talking Send Message to TreeView

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Integer, ByVal wParam As String, lParam As Any) As Long
    Const LB_FINDSTRING = &H18F


    Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    ListView1.ListIndex = SendMessage(ListView1.hwnd, LB_FINDSTRING, Text1, ByVal Text1.Text)
    End Sub


    The above code: When I press any key The item of TreeView1 will change to the other item that has text like string in Text1.

    If i use TreeView stead ListView please tell me the change of code above

  2. #2
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923

    treeview findstring

    There is no FindString function in TreeView control, you'll have to create one of yourself or to use the index, by the way, you know you can use FindString function instead of sending a message for your listview?

    JeffB
    CodeGuru VB FAQ Visual Basic Frequently Asked Questions
    VB Code color Tool to color your VB code on CodeGuru
    Before you post Importants informations to know before posting

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

Featured