Background color change.

Hi Syncfusion, I am working with tree control. I want the node''s background color to be changed when it is right clicked., i.e when I right click, the selected node is supposed to display some message. I want this right clicked node to be highlighted with the specified background color. Thanks in Advance. Carl.

1 Reply

DT Deepa TS Syncfusion Team February 16, 2006 09:54 AM UTC

Hi Carl, Node''s background colors can be controlled by the InactiveSelectedNodeBackground and the InactiveSelectedNodeForeColor properties of the TreeViewAdv control. Code: this.treeViewAdv1.HideSelection = false; private void treeViewAdv1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { if(e.Button == MouseButtons.Right) { Point p = this.treeViewAdv1.PointToClient(Control.MousePosition); TreeNodeAdv node = this.treeViewAdv1.PointToNode(p); this.treeViewAdv1.SelectedNode = node; MessageBox.Show("Rightclicked on " + node.Text); } } Please take a look at the attached sample and let me know if this helps you. Thanks for your continued interest in Syncfusion Products. Regards, Deepa.T.S

NodeBackground.zip

Loader.
Up arrow icon