473,465 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

rant - vb.net treeview control nodeclick event missing?

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)
' VB6 code here.
End Sub

The VB.NET way seems to be inspect the SelectedNode property within the
TreeView's Click event... however this is extreamly buggy, and actually
fails under some very simple circumstances, telling me that one node is
selected, when in fact a different node is shown as selected. This is easily
reproducible behaviour, and I'll send the code if anyone's interested.

I find it hard to believe that Microsoft programmers STILL can't produce
good quality code (although I should not be surprised). It's like the
TreeView control is something they just can't fathom. We've had it for
years!!! You'd think it should actually get better - not worse!

I am using the Infragistics UltraTreeView control and although it does not
have a NodeClick event either, it's SelectedNode property seems to work as
expected. As a result, I am not going to use the Microsoft control.

Summary:

* Microsoft can't write TreeView controls.

* Microsoft can't write decent help files.
Not only does the help file contain utterly useless crap (and send you
around in circles) it is so SLOW on my Dual Pentium Processor (2.4GHz) that
it is quicker for me to look up information using Google, than it is to
interrogate my own Hard Drive. Is this progress my Microsoft? You decide.

* Did I mention the help file was useless? Oh yeah... sorry.

- Peter


Nov 20 '05 #1
17 9089
Cor
Hi Spam,
I find it hard to believe that Microsoft programmers STILL can't produce
good quality code (although I should not be surprised). I am using the Infragistics UltraTreeView control and although it does not
have a NodeClick event either, it's SelectedNode property seems to work as
expected.


You are not really able to tell if the SelectedNode property works in your
program as expected.

Are you sure that you have the the right to blame the Microsoft programmers?

Just my thought.

Cor
Nov 20 '05 #2
* "Spam Trap" <sp**@midar.com> scripsit:
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
' VB6 code here.
End Sub

The VB.NET way seems to be inspect the SelectedNode property within the
TreeView's Click event... however this is extreamly buggy, and actually
fails under some very simple circumstances, telling me that one node is
selected, when in fact a different node is shown as selected. This is easily
reproducible behaviour, and I'll send the code if anyone's interested.
Can you post some code to easily reproduce that behavior?
Not only does the help file contain utterly useless crap (and send you
around in circles) it is so SLOW on my Dual Pentium Processor (2.4GHz) that
it is quicker for me to look up information using Google, than it is to
interrogate my own Hard Drive. Is this progress my Microsoft? You decide.


Mhm... The MSDN Library runs very fast on my PII 350 MHz.

;->

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
"Cor" <no*@non.com> wrote in message
news:eS**************@TK2MSFTNGP11.phx.gbl...
Hi Spam,
I find it hard to believe that Microsoft programmers STILL can't produce
good quality code (although I should not be surprised).
I am using the Infragistics UltraTreeView control and although it does not have a NodeClick event either, it's SelectedNode property seems to work as expected.


You are not really able to tell if the SelectedNode property works in your
program as expected.

Are you sure that you have the the right to blame the Microsoft

programmers?
Just my thought.

Cor


That's quite a bold statement yourself! How long have you been programming
with VB.any-version?

- Peter

Nov 20 '05 #4
Cor
I did not do that statement you did

it's SelectedNode property seems to work
Nov 20 '05 #5
Mr.Spam,

How long ago Cor became a programmer is irrelevant to this discussion.

However if you must know Cor is an excellent programmer.

..AfterSelect may be something you want to look into.

Don't come back and insult anyone else. I have had my fill of it and my
tolerance is low.
"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
"Cor" <no*@non.com> wrote in message
news:eS**************@TK2MSFTNGP11.phx.gbl...
Hi Spam,
I find it hard to believe that Microsoft programmers STILL can't produce good quality code (although I should not be surprised).
I am using the Infragistics UltraTreeView control and although it does not have a NodeClick event either, it's SelectedNode property seems to
work as expected.


You are not really able to tell if the SelectedNode property works in your program as expected.

Are you sure that you have the the right to blame the Microsoft

programmers?

Just my thought.

Cor


That's quite a bold statement yourself! How long have you been programming
with VB.any-version?

- Peter

Nov 20 '05 #6
Maybe you should have spent a littl more time looking at teh help.

The example code shown at the topic for GetNodeAt(...) should be fool-proof.

HTH
Brian W
"Spam Trap" <sp**@midar.com> wrote in message
news:40***********************@news.optusnet.com.a u...
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)
' VB6 code here.
End Sub

The VB.NET way seems to be inspect the SelectedNode property within the
TreeView's Click event... however this is extreamly buggy, and actually
fails under some very simple circumstances, telling me that one node is
selected, when in fact a different node is shown as selected. This is easily reproducible behaviour, and I'll send the code if anyone's interested.

I find it hard to believe that Microsoft programmers STILL can't produce
good quality code (although I should not be surprised). It's like the
TreeView control is something they just can't fathom. We've had it for
years!!! You'd think it should actually get better - not worse!

I am using the Infragistics UltraTreeView control and although it does not
have a NodeClick event either, it's SelectedNode property seems to work as
expected. As a result, I am not going to use the Microsoft control.

Summary:

* Microsoft can't write TreeView controls.

* Microsoft can't write decent help files.
Not only does the help file contain utterly useless crap (and send you around in circles) it is so SLOW on my Dual Pentium Processor (2.4GHz) that it is quicker for me to look up information using Google, than it is to
interrogate my own Hard Drive. Is this progress my Microsoft? You decide.

* Did I mention the help file was useless? Oh yeah... sorry.

- Peter


Nov 20 '05 #7
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:up**************@tk2msftngp13.phx.gbl...
* "Spam Trap" <sp**@midar.com> scripsit:
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
' VB6 code here.
End Sub

The VB.NET way seems to be inspect the SelectedNode property within the
TreeView's Click event... however this is extreamly buggy, and actually
fails under some very simple circumstances, telling me that one node is
selected, when in fact a different node is shown as selected. This is easily reproducible behaviour, and I'll send the code if anyone's interested.
Can you post some code to easily reproduce that behavior?
Not only does the help file contain utterly useless crap (and send you
around in circles) it is so SLOW on my Dual Pentium Processor (2.4GHz) that it is quicker for me to look up information using Google, than it is to
interrogate my own Hard Drive. Is this progress my Microsoft? You

decide.
Mhm... The MSDN Library runs very fast on my PII 350 MHz.

;->

--
Herfried K. Wagner [MVP]
http://www.mvps.org/dotnet


Steps to reproduce behaviour:

1) Create a form, place a treeview control on it.
2) Paste this code.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim nodX As TreeNode
nodX = Me.TreeView1.Nodes.Add("Parent Node")
nodX.Nodes.Add("Child Node")
End Sub

Private Sub TreeView1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TreeView1.Click
MsgBox(Me.TreeView1.SelectedNode.Text)
End Sub

3) When you click on the parent, the correct node is displayed.
4) Expand the parent node (by clicking on the little plus symbol).
5) Click on the Child. Despite hilighting the child node (when the mouse
button is down), the "parent" is returned. Only after the "TreeView1_Click"
routine has completed, does the node get selected. I believe this makes the
Click event useless when used in conjuction with the SelectedNode property.

If you alternatly click each node, you will always get the wrong result
returned. Only clicking the node twice (not a double-click), will return the
expected result.

Now... is this just my computer doing this, or does anyone owe me an
apology?

- Peter
Nov 20 '05 #8
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:up**************@tk2msftngp13.phx.gbl...
* "Spam Trap" <sp**@midar.com> scripsit:
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
' VB6 code here.
End Sub

The VB.NET way seems to be inspect the SelectedNode property within the
TreeView's Click event... however this is extreamly buggy, and actually
fails under some very simple circumstances, telling me that one node is
selected, when in fact a different node is shown as selected. This is easily reproducible behaviour, and I'll send the code if anyone's interested.
Can you post some code to easily reproduce that behavior?
Not only does the help file contain utterly useless crap (and send you
around in circles) it is so SLOW on my Dual Pentium Processor (2.4GHz) that it is quicker for me to look up information using Google, than it is to
interrogate my own Hard Drive. Is this progress my Microsoft? You

decide.
Mhm... The MSDN Library runs very fast on my PII 350 MHz.

;->

--
Herfried K. Wagner [MVP]
http://www.mvps.org/dotnet


Steps to reproduce behaviour:

1) Create a form, place a treeview control on it.
2) Paste this code.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim nodX As TreeNode
nodX = Me.TreeView1.Nodes.Add("Parent Node")
nodX.Nodes.Add("Child Node")
End Sub

Private Sub TreeView1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TreeView1.Click
MsgBox(Me.TreeView1.SelectedNode.Text)
End Sub

3) When you click on the parent, the correct node is displayed.
4) Expand the parent node (by clicking on the little plus symbol).
5) Click on the Child. Despite hilighting the child node (when the mouse
button is down), the "parent" is returned. Only after the "TreeView1_Click"
routine has completed, does the node get selected. I believe this makes the
Click event useless when used in conjuction with the SelectedNode property.

If you alternatly click each node, you will always get the wrong result
returned. Only clicking the node twice (not a double-click), will return the
expected result.

Now... is this just my computer doing this, or does anyone owe me an
apology?

- Peter
Nov 20 '05 #9
Peter,

Thanks for playing.

Go Away.
Nov 20 '05 #10
Peter,

Thanks for playing.

Go Away.
Nov 20 '05 #11
So you

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:Ov**************@TK2MSFTNGP09.phx.gbl...
Peter,

Thanks for playing.

Go Away.

Nov 20 '05 #12
So you

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:Ov**************@TK2MSFTNGP09.phx.gbl...
Peter,

Thanks for playing.

Go Away.

Nov 20 '05 #13

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:Ov**************@TK2MSFTNGP09.phx.gbl...
Peter,

Thanks for playing.

Go Away.


So you think the code I posted does not contain confusing behaviour or bugs?

It's convient that you want me to go away, the very instant I provide you
proof. That must make you feel uncomfortable since you were so willing to
leap to the defence of someone that insulted my ability to find a bug with
Microsoft's treeview control (specifically with the Click event and the
SelectedNode property). If it isn't an outright bug, then at the least it's
confusing behaviour that 3rd party vendors have not been keen to emulate.
IMHO, it's a bug.

- Peter
Nov 20 '05 #14

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:Ov**************@TK2MSFTNGP09.phx.gbl...
Peter,

Thanks for playing.

Go Away.


So you think the code I posted does not contain confusing behaviour or bugs?

It's convient that you want me to go away, the very instant I provide you
proof. That must make you feel uncomfortable since you were so willing to
leap to the defence of someone that insulted my ability to find a bug with
Microsoft's treeview control (specifically with the Click event and the
SelectedNode property). If it isn't an outright bug, then at the least it's
confusing behaviour that 3rd party vendors have not been keen to emulate.
IMHO, it's a bug.

- Peter
Nov 20 '05 #15
> It's convient that you want me to go away, the very instant I provide you
proof.
The issue is not the code.

The issue is your attitude.
That must make you feel uncomfortable since you were so willing to
leap to the defence of someone that insulted my ability


As I am familiar with Cor and his skills you bet I will defend him as I
would any regular on this board you chose to insult. Cor never meant to
insult you and I am sorry you took it that way.

People put time in here to help people and should not be treated
disrespectfully.

My suggestion is to lower the temperature of your rhetoric. It does not come
across well.

That being said, you are probably suffering from "IAmIronMan" (If you do not
know about this don't ask too long of a story) after effects at least with
me. Tolerance on this board right now for rudeness is at an all time low.

Lets just let this go and look at it another day when we are in better
moods. I may even volunteer to assist you in resolving this issue at that
point.
Nov 20 '05 #16
> It's convient that you want me to go away, the very instant I provide you
proof.
The issue is not the code.

The issue is your attitude.
That must make you feel uncomfortable since you were so willing to
leap to the defence of someone that insulted my ability


As I am familiar with Cor and his skills you bet I will defend him as I
would any regular on this board you chose to insult. Cor never meant to
insult you and I am sorry you took it that way.

People put time in here to help people and should not be treated
disrespectfully.

My suggestion is to lower the temperature of your rhetoric. It does not come
across well.

That being said, you are probably suffering from "IAmIronMan" (If you do not
know about this don't ask too long of a story) after effects at least with
me. Tolerance on this board right now for rudeness is at an all time low.

Lets just let this go and look at it another day when we are in better
moods. I may even volunteer to assist you in resolving this issue at that
point.
Nov 20 '05 #17
cool.

- Peter

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:O0**************@TK2MSFTNGP11.phx.gbl...
It's convient that you want me to go away, the very instant I provide you proof.
The issue is not the code.

The issue is your attitude.
That must make you feel uncomfortable since you were so willing to
leap to the defence of someone that insulted my ability


As I am familiar with Cor and his skills you bet I will defend him as I
would any regular on this board you chose to insult. Cor never meant to
insult you and I am sorry you took it that way.

People put time in here to help people and should not be treated
disrespectfully.

My suggestion is to lower the temperature of your rhetoric. It does not

come across well.

That being said, you are probably suffering from "IAmIronMan" (If you do not know about this don't ask too long of a story) after effects at least with
me. Tolerance on this board right now for rudeness is at an all time low.

Lets just let this go and look at it another day when we are in better
moods. I may even volunteer to assist you in resolving this issue at that
point.

Nov 20 '05 #18

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

Similar topics

0
by: marian | last post by:
Hi I have changed the control in my form to a Treeview 6 instead of 5 and my code no longer works as before. Can anybody help me here. There are no errors, but I only end up with the first...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
6
by: rob willaar | last post by:
I seem to miss then treeview NodeClick How can i check if a node is clicked when it is selected?
0
by: Athan | last post by:
I use MS activex treeview control in my asp pages. The problem I have is that some computers display the treeview with no problems while others display the control without the text on the nodes. I...
3
by: Dean Earley | last post by:
Has anyone had the NodeClick event not firing in VB6 with the VB5 Treeview control? It fires correctly when using the cursor keys to select nodes but there is nothing when i click a node. It...
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...
3
by: sianan | last post by:
Hi, I want to display a 'hover box' (for want of a better description) when the mouse hovers over a node in a tree view. The box would display detail information for the node. It should be...
2
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.