Hi all,
I wanted to know if a node in tree view is double clicked,
I tried clicks property on MouseDown but it always returns 1.
any solutions for this problem


regards,
...

Re: Double Click on TreeView by Palo

Palo
Fri Jul 11 07:38:38 CDT 2003

TreeView.DoubleClick event is your friend:-)

Palo
http://www.vbinfozine.com - Genuine stories for VB and .NET developers

"NotYetaNurd" <NotYetaNurd@Matrix.com> wrote in message
news:eGsbiK3RDHA.1304@TK2MSFTNGP11.phx.gbl...
> Hi all,
> I wanted to know if a node in tree view is double clicked,
> I tried clicks property on MouseDown but it always returns 1.
> any solutions for this problem
>
>
> regards,
> ...
>
>
>



Re: Double Click on TreeView by Palo

Palo
Fri Jul 11 10:27:42 CDT 2003

This worked for me:

1. Save the mouse coordinates from the last MouseUp event into a Form
member:

' This is your Form's member:
Private _MouseCoords As System.Drawing.Point
...
Private Sub TreeView1_MouseUp(...) Handles TreeView1.MouseUp
With _MouseCoords
.X = e.X
.Y = e.Y
End With
End Sub

2. Check if the coordinates are within the double-clicked node:

Private Sub TreeView1_DoubleClick(...) Handles TreeView1.DoubleClick
Dim Node As System.Windows.Forms.TreeNode =
TreeView1.GetNodeAt(_MouseCoords)
If (Not Node Is Nothing) AndAlso Node.Bounds.Contains(_MouseCoords) Then
MsgBox("Double:-)")
End If
End Sub

--
http://www.vbinfozine.com - genuine stories for VB and .NET developers

"NotYetaNurd" <NotYetaNurd@Matrix.com> wrote in message
news:uuTv1n7RDHA.2148@TK2MSFTNGP10.phx.gbl...
> One problem i forgot to mention ..
> when i use doubleclick eventhandler..
> Even when i double click on the empty spaces in the right ..the handler is
> activated ...
>
> .....
>
>
>
> "Palo Mraz" <palo@lamarvin.com> wrote in message
> news:#bvAuk6RDHA.2144@TK2MSFTNGP11.phx.gbl...
> > TreeView.DoubleClick event is your friend:-)
> >
> > Palo
> > http://www.vbinfozine.com - Genuine stories for VB and .NET developers
> >
> > "NotYetaNurd" <NotYetaNurd@Matrix.com> wrote in message
> > news:eGsbiK3RDHA.1304@TK2MSFTNGP11.phx.gbl...
> > > Hi all,
> > > I wanted to know if a node in tree view is double clicked,
> > > I tried clicks property on MouseDown but it always returns 1.
> > > any solutions for this problem
> > >
> > >
> > > regards,
> > > ...
> > >
> > >
> > >
> >
> >
>
>