Your main issue is that a Windows Forms TreeNode
does not derive from a Control
like a TreeView
does (or, for example, a Button
). It's much closer to a "model" class, meaning that it's primarily concerned with the hierarchical organization of your data. Although some of the presentational abstraction is leaked in properties like Color
, Bounds
, Handle
and similar, a TreeNode
doesn't know how to paint itself, nor how to handle click events.
On the other hand, a TreeView
is an actual Control
, meaning you can derive from it and be able to override its protected OnClick
method, like shown in the example you linked.
If you want to follow that path, you could create your derived TreeView
class from it and override the protected OnNodeMouseClick
method. This method is specific to the TreeView
and called by its WndProc
method when a certain node is clicked.
But having read your comments to other answers, it seems that this is not what you really need to do to accomplish your goal.