Disable hot-track problem?
Hi,
I am using hot-tracking,
Is there a way to ignore this setting on certain nodes?
I am looking for an e.cancel=true
but they seem didn't work in nodebeforepaint. (e.handled=true overrides everything)
Is there a way to achieve this?
A temporary solution I came up with is to repaint the background but I am not sure what brushinfo settings to repaint exactly like that.
Ex: n.Background = New BrushInfo(BackwardDiagonal, Color.Red, Color.Yellow) (how to redraw this color in Nodebeforepaint)
Thanks you!
jamin.
private void TreeViewAdv1_BeforeNodePaint(object sender, TreeNodeAdvPaintEventArgs e) { if(e.Node.Text == "Parent1") { e.HotTracked = false; e.ForeColor = Color.Black; } } |
Hi Sweatha,
I tried but the node background color is still overwritten by the hot-track color.
Is there a way to handled-background? (currently I see it is ignoring text highlight)
Thank you!
jamin
We have reviewed your query and suspect that you are applying a style to the TreeViewAdv. When you enable hot tracking, the background, underline, and forecolor are applied to the node. However, when hot tracking is disabled using our previous provided suggestion, the background color still remains.
Can you confirm if this is the scenario you reported? If so, could you please share details about the style you are using? If not, kindly provide a video demonstration of the issue or a code snippet. This information will help us proceed further and provide a better solution.
Hi Sweatha,
I have attached a demo and description file.
Thanks you,
jamin.
Attachment: test_a5c02288.rar
Hi jamin ,
We have reviewed the sample you provided. As we suspected, the style you are using for the TreeViewAdv in your sample is causing the background to be applied to the hovered node. To prevent this, you can disable the background on hover by using the NodeBackgroundPaint event. In this event, you can handle the background for specific nodes.
We have modified the sample you provided accordingly. Please review it and let us know if you have any concerns.
private void TreeViewAdv1_NodeBackgroundPaint(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvPaintBackgroundEventArgs e) { if(e.Node.Text == "Node3") { e.Handled = true; } } |
Attachment: WindowsFormsApp1_4e89d970.zip