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

    treeview control

    i am having one treeview control ,in that treeview control i am having parentnodes,childnodes.when i select that childnode i want display some controls
    where i have to write code

  2. #2
    Join Date
    Apr 2005
    Location
    India
    Posts
    271

    Smile Re: treeview control

    You could add the event handler code for the click or doubleclick event of the treeview

    Ex:
    if treeview is named 'tv1' you could write the following code to get the currently selected child node

    tv1.SelectedNode.text

    Use the return for the above code in a select case statement to write your eeded code.

    a case when a problem can arise is when nothing is selected in treeview
    you can handle that using the followin code

    If TV1.SelectedNode Is Nothing Then
    ' Your code here
    end if

    Hope that this will be of help

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