CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2000
    Location
    St. Paul, Minnesota
    Posts
    49

    keep select node in tree control highlighted

    I am trying to keep the select node highlighted.
    I can keep it selected and highlighted this way but when I click on another node this stays selected. Then I have two nodes selected.

    private Sub cmdMoveSlideDown_Click()
    Dim currIndex as Integer
    Dim mNode as Node

    currIndex = getCurrentSlideIndex
    currentPackage.updateSlide currIndex, 1
    loadSlideList

    If currIndex + 1 > tv.Nodes.Count - 1 then

    set mNode = tv.Nodes.Item(2)
    mNode.Selected = true
    'mNode.BackColor = vbBlue

    'tv.Nodes.Item(2).Selected = true
    'tv.Nodes.Item(2).BackColor = vbBlue
    else
    set mNode = tv.Nodes(currIndex + 2)
    mNode.Selected = true
    ' mNode.BackColor = vbBlue
    'tv.Nodes.Item(currIndex + 2).Selected = true
    'tv.Nodes.Item(currIndex + 2).BackColor = vbBlue
    End If
    needToReloadList = true
    updateMenus
    End Sub







  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: keep select node in tree control highlighted

    The treeview control has a property called HideSelection wich hides the selection when the control doesn't has the focus. Set this property to false and the selection will remain visible.

    Tom Cannaerts
    [email protected]

    The best way to escape a problem, is to solve it.
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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