473,387 Members | 1,541 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,387 software developers and data experts.

TreeView need help

Hello

I have a TreeView in my Window application. In that I have some nodes
(parent nodes), each parent node has some children. What I want is that when
I double click a node (either parent or children), I can print the Text of
that node. I have:

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

However, by using this method, I can print a text for a parent node but not
for a child node. Coul you please help

Thanks

S.Hoa
Nov 21 '05 #1
4 1593
If I understand your question/problem correctly, this works:

Private Sub TreeView1_DoubleClick(ByVal sender As Object, ByVal e
As System.EventArgs) Handles TreeView1.DoubleClick
Label1.Text = TreeView1.SelectedNode.Text
End Sub

John

Nov 21 '05 #2
Using your method, I can get only the text of the parent node
S.Hoa

"johnb41" <or****@informatik.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
If I understand your question/problem correctly, this works:

Private Sub TreeView1_DoubleClick(ByVal sender As Object, ByVal e
As System.EventArgs) Handles TreeView1.DoubleClick
Label1.Text = TreeView1.SelectedNode.Text
End Sub

John

Nov 21 '05 #3
For me, I got the text of the parent and the children. Hmmm... I'm
stumped. Hopefully someone else here can help?

John

Nov 21 '05 #4
Thank you for your help
It work. The problem here is in my code, there are two functions
TreeView1_DoubleClick
TreeView1_DoubleClick1

So I have to delete one
Regards
S.Hoa
Nov 21 '05 #5

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

Similar topics

1
by: Anthony Boudouvas | last post by:
Hi to all, i have a treeview that i put some nodes in it with their repsective images. If i try to change the image and set it to some other ImageList index, nothing happens. The code i use...
2
by: Sonia Igla | last post by:
Hi. I need to perform DBLCLK on TreeView Node. I try the following: private static extern int SendMessage(IntPtr hWnd, uint msg, UInt32 wParam, UInt32 lParam); private const UInt32...
2
by: DJG | last post by:
I need some help with a TreeView control in VB.Net I've got a datatable with about 8000 rows. 500 are 'folders', and the other 7500 rows are 'jobs'. It's a logical representation of some data,...
3
by: Jan Wrage | last post by:
Hi! I would like to implement a treeview in my existing application. It should show my entire Active-Directory structure, i.e. all Groups, Containers and OUs. Could somebody help me with...
10
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a...
5
by: Paul | last post by:
Hi, I am a self taught VBA programmer, and I'm trying to learn VB2005 Express (The price was right). I like the look of the treeview control, and I'd like to use it as a menu system for my users,...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
0
by: Erland | last post by:
Hello all, I have just installed visual studio .net 2005 and started developing programs in asp.net 2.0. I have a scenerio where I have to populate treeview child nodes based on the entries...
2
by: rolf.oltmans | last post by:
Hello all, I need to place treeview control in Grid control. I need to place it in a grid because I need to show calendar against every node. Is placing a treeview in grid possible? If I need...
2
by: casManG | last post by:
I am working on a small project that uses the treeview control in vb.net 2003. I have a tree view that I am sending to a sub in order to iterate through the nodes. Public Sub test (ByVal...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.