TreeView and Checkboxes

T

Trecius

Hello, Newsgroupians:

A quick question regarding checkboxes and a treeview. I have a treeview
that has the property CheckBoxes. However, I'm also trying to handle the
event NodeMouseClick. I only want the event to run some code only if the
user clicks the check box. This means that if the user clicks the "text" of
the TreeNode, it will do nothing. However, if the user clicks the checkbox,
which is next to the "text" the code will execute. I've been looking online
for how to accomplish this, but I have not found anything. Does anyone know
how I might accomplish this? Thank you.


Trecius
 
P

Pavel Minaev

Trecius said:
A quick question regarding checkboxes and a treeview. I have a treeview
that has the property CheckBoxes. However, I'm also trying to handle the
event NodeMouseClick. I only want the event to run some code only if the
user clicks the check box. This means that if the user clicks the "text"
of
the TreeNode, it will do nothing. However, if the user clicks the
checkbox,
which is next to the "text" the code will execute. I've been looking
online
for how to accomplish this, but I have not found anything. Does anyone
know
how I might accomplish this? Thank you.

It sounds like what you actually need is the way to determine when the node
is checked or unchecked (since that's what a click on the checkbox will do).
In which case, you should look at BeforeCheck and AfterCheck events of the
TreeView.
 

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