How to: Implement "Click" event in a TreeView Control using .Net C

G

Guest

I would like to implement the following functionality:

When a user taps a (child) treeNode, an event fires which allows me to get
the selected treeNode's TAG object, determine it's values, and then load a
new form based on those values...

Intellisense shows the "Click" event, however, this does nothing. (I assume
it's not supported in .Net CF?) I see via Design Mode in VS 2003 that the
only feasible event is "AfterSelected". This, however, seems to loop through
all of the the treeNodes. I have to implement some sort of "hack" to avoid
this....

Any ideas on how to make the above happen?

Thanks,
 
G

Guest

To further my original question, i've run into another problem: Using the
AfterSelect event, this event runs through all of the nodes. I had thought
that i can cancel this event via the TreeViewCancelEventArgs class, however,
i cannot manage to make this work. Reading "Consuming Events" via MSDN
Library seems quite involved, and slightly beyond my understanding. Can
someone provide an example on how to make this event "cancel".

Currently, when the AfterSelect event loops though nodes which have not been
selected, i "avoid" exit the event by testing:

if (e.Action ==TreeViewAction.Unknown) return;

This, nevertheless, does not avoid the fact that the event contnues to loop
through all nodes....

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top