473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

TreeView double click event

HS1
Hellow all
Could you please tell me how to do if I want to print (using console) any
node in a TreeView when I "double" click a node (in a Windows application).
I tried to use TreeViewAfterSelect event, However, it is not good as it is
single click.
Thanks
SH1
Nov 21 '05 #1
1 5328
try this:

Private m_x As Integer
Private m_y As Integer

Private Sub TreeView1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) _
Handles TreeView1.MouseDown
m_x = e.X
m_y = e.Y
End Sub

Private Sub TreeView1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TreeView1.DoubleClick
Dim objTreeNode As TreeNode

objTreeNode = TreeView1.GetNodeAt(m_x, m_y)
If Not (objTreeNode Is Nothing) Then
Debug.WriteLine("You double clicked " & objTreeNode.Text)
End If

End Sub

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"HS1" <so*@slingshot.co.nz> escribió en el mensaje
news:1107226939.706140@ftpsrv1...
Hellow all
Could you please tell me how to do if I want to print (using console) any
node in a TreeView when I "double" click a node (in a Windows
application).
I tried to use TreeViewAfterSelect event, However, it is not good as it is
single click.
Thanks
SH1

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the...
6
by: Tim | last post by:
Hi I have a form with a treeview on it. When I select a particular node it adds/shows a tab on the form. The treeview node remains selected as it should. The user can close the tab or remove the...
14
by: Evan Kontos | last post by:
I am trying to implement a Treeview w/an XML file and I even copied and pasted examples from MSDN but can't get them to work. Any suggestions welcome. XML File <TREENODES> <TREENODE...
17
by: Spam Trap | last post by:
I am upgrading from VB6 where I had access to a treeview NodeClick event (see below)... but now VB.NET does not have this any more. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)...
0
by: samirtripathy | last post by:
I am loading data from a XML file and populating a TreeVew. I store certain values in the tags of the treevew nodes using the following code -------------------- Dim servernode As New...
4
by: John Dann | last post by:
I'm trying to implement a fairly simple Treeview procedure but running into problems. My Treeview has just two levels of nodes: top-level and one child level. I want a doube-click on the...
2
by: celoftis | last post by:
Using VS2005, ASP.NET. Check out the tree view on this page: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.aspx When you hover over the border between the two...
1
by: ruthie | last post by:
Hi, If I double click any node in the treeview (besides the root node) - the child nodes aren't expendad automatically so I must click the checkbox. As I understand whenever a double click...
5
by: Peter Duniho | last post by:
On Sat, 27 Sep 2008 12:02:04 -0700, <timor.super@gmail.comwrote: You don't, not when you don't know that one event is necessarily going to follow another. If the events can appear alone, then...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.