Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How can use treenode's checkbox to control other controls whether are visible or not?

How can use treenode's checkbox to control other controls whether are visible or not?

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sanyexian
    wrote on last edited by
    #1

    Hi,Friends! I used a treeview with checkbox in my form, now I want that after I checked a node, a groupbox was visible, after I made the treenode unchecked, the groupbox was hidden.It is easy when I use checkbox ,but I don't know how to do this with treenode. I used AfterCheck event like this:

    Private Sub treeMingPai_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles treeMingPai.AfterCheck
    If e.Node.Text = "English" Then
    e.Node.ForeColor = Color.RoyalBlue
    grpYWMP.Visible = True
    End If
    End Sub

    It could make hidden groupbox visible when I had checked the treenode, but what should I do to make it hidden after I made it unchecked again? PLX help me and give me some suggestions!Thans a lot!

    E 1 Reply Last reply
    0
    • S sanyexian

      Hi,Friends! I used a treeview with checkbox in my form, now I want that after I checked a node, a groupbox was visible, after I made the treenode unchecked, the groupbox was hidden.It is easy when I use checkbox ,but I don't know how to do this with treenode. I used AfterCheck event like this:

      Private Sub treeMingPai_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles treeMingPai.AfterCheck
      If e.Node.Text = "English" Then
      e.Node.ForeColor = Color.RoyalBlue
      grpYWMP.Visible = True
      End If
      End Sub

      It could make hidden groupbox visible when I had checked the treenode, but what should I do to make it hidden after I made it unchecked again? PLX help me and give me some suggestions!Thans a lot!

      E Offline
      E Offline
      Estys
      wrote on last edited by
      #2

      The AfterCheck event is raised by both checking and unchecking actions. So base your actions on e.Node.Checked. Cheers

      I don't like my signature at all

      S 1 Reply Last reply
      0
      • E Estys

        The AfterCheck event is raised by both checking and unchecking actions. So base your actions on e.Node.Checked. Cheers

        I don't like my signature at all

        S Offline
        S Offline
        sanyexian
        wrote on last edited by
        #3

        Hi,Estts!Thanks for your suggestion!I've do it!THX!

        E 1 Reply Last reply
        0
        • S sanyexian

          Hi,Estts!Thanks for your suggestion!I've do it!THX!

          E Offline
          E Offline
          Estys
          wrote on last edited by
          #4

          You're welcome :thumbsup: Cheers

          I don't like my signature at all

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups