AD
Administrator
Syncfusion Team
April 13, 2005 03:38 PM UTC
Hi Jeremy,
TreeViewAdv contains methods that allow you to convert Control.MousePosition into a location inside the TreeViewAdv. If you handle MouseDown, you can use those methods to detect whether or not a label was clicked on and set the Checked property accordingly. The following code snippet demonstrates this:
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;
}
}
}
}
Hope it helps.
Regards,
Gregory Austin
Syncfusion Inc.