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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. treeview doubleclick

treeview doubleclick

Scheduled Pinned Locked Moved C#
question
5 Posts 3 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.
  • T Offline
    T Offline
    thepersonof
    wrote on last edited by
    #1

    hi at the moment i'm handling the doubleclick event. how can i check whether a leaf node was doubleclicked or whether the user just double clicked whitespace? thanks

    G P 2 Replies Last reply
    0
    • T thepersonof

      hi at the moment i'm handling the doubleclick event. how can i check whether a leaf node was doubleclicked or whether the user just double clicked whitespace? thanks

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Handle MouseDoubleClick event and then create instance of TreeViewHitTestInfo based on the parameter of the event

      my articles

      1 Reply Last reply
      0
      • T thepersonof

        hi at the moment i'm handling the doubleclick event. how can i check whether a leaf node was doubleclicked or whether the user just double clicked whitespace? thanks

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        I use things like:

            private void tvReports\_MouseDoubleClick ( object sender , System.Windows.Forms.MouseEventArgs e )
            {
                System.Windows.Forms.TreeNode nod ;
                
                if  
                ( 
                    ( e.Button == System.Windows.Forms.MouseButtons.Left )
                &&
                    ( ( nod = this.tvReports.GetNodeAt ( e.Location ) ) != null )
                )
                {
        
        G 1 Reply Last reply
        0
        • P PIEBALDconsult

          I use things like:

              private void tvReports\_MouseDoubleClick ( object sender , System.Windows.Forms.MouseEventArgs e )
              {
                  System.Windows.Forms.TreeNode nod ;
                  
                  if  
                  ( 
                      ( e.Button == System.Windows.Forms.MouseButtons.Left )
                  &&
                      ( ( nod = this.tvReports.GetNodeAt ( e.Location ) ) != null )
                  )
                  {
          
          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          I use things like this:

          TreeViewHitTestInfo hit=treeview1.HitTest(e.Location)

          you should write it in the event handler of OnNodeMouseDoubleClick

          my articles

          T 1 Reply Last reply
          0
          • G Giorgi Dalakishvili

            I use things like this:

            TreeViewHitTestInfo hit=treeview1.HitTest(e.Location)

            you should write it in the event handler of OnNodeMouseDoubleClick

            my articles

            T Offline
            T Offline
            thepersonof
            wrote on last edited by
            #5

            thank you

            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