Hi Jubin,
It is possible to get the AfterCheck event triggered when a node''''s text is clicked instead of the checkbox by handling MouseDown event along with the PointToClient and PointToNode method.
private void treeViewAdv1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left) { // get the point where the mouse was left clicked Point p = this.treeViewAdv1.PointToClient(Control.MousePosition);
// get the node at the left click point
TreeNodeAdv node = this.treeViewAdv1.PointToNode(p);
if (node != null)
{
// see if the label was clicked on
if (node.TextAndImageBounds.Contains(p))
{
node.Checked =!node.Checked;
}
}
}
}
Please take alook at the attached sample and let me know if this helps you.
LabelCheck.zip
Regards,
Deepa.