We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Color of Node

Hi Froum, How to high light the color of the selected node. I mean, is there any way to change the color of the selected node. Any help will be appreciated. Thanks, Regards, Thomas

1 Reply

DT Deepa TS Syncfusion Team April 12, 2006 09:38 AM UTC

Hi Thomas, The SelectedNode in the TreeViewAdv can be highlighted through changing its color by handling TreeViewAdv BeforeNodePaint Event handler: Code: private void treeViewAdv1_BeforeNodePaint(object sender,Syncfusion.Windows.Forms.Tools.TreeNodeAdvPaintEventArgs e) { if(e.Node.IsSelected==true) { SolidBrush brush=new SolidBrush(Color.LightSalmon); Rectangle rec=new Rectangle(e.Node.TextBounds.X,e.Node.TextBounds.Y, e.Node.TextBounds.Width,e.Node.TextBounds.Height); e.Graphics.FillRectangle(brush,rec); } } Please take a look at the attached sample and let me know if this helps you. SelectedNodeHighlight Thanks for your interest in Syncfusion products. Kind Regards, Deepa.

Loader.
Live Chat Icon For mobile
Up arrow icon