The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I'm having a problem programatically changing the color of the text of a label in a Node on in my diagram. I have looked for a property for text color in both the Label and RoundRect classes but do not see properties to set text color?
J.J.Nagarajan Syncfusion Team July 14, 2008 01:53 PM UTC
Hi bbarnard ,
Sorry for the inconvenience caused. You can not set the text color to the labels. Please use our TextNode instead. You can group the textnode on the RoundedRect and display the text as the label.
TextNode n = new TextNode("Novo texto"); //To set TextColor. n.FontColorStyle.Color = Color.Green; n.SizeToText(SizeF.Empty); n.PinPoint=new PointF(200, 200); n.Size=new SizeF(100,40); n.EnableCentralPort = true; n.WrapText = true; this.diagramWebControl.Model.AppendChild(n);
Please let me know if this helps.
Regards, Nagaraj
J.J.Nagarajan Syncfusion Team July 15, 2008 04:30 AM UTC
Hi Bryan ,
To change the TextColor of a node, you have to derive the Label class and override the Render() method. You can change the text color in this Render() method. Please refer to the following code snippet.
class MyLabel:Label { public MyLabel(string Text) { this.Text = Text;