Hi Prasanthi,
Thanks for your interest in Syncfusion products.
We suggest you to use the ‘FillStyle’ class to apply color
for the Label’s text. Please refer the below code snippet to achieve your
requirement.
Here is the code:
[C#]
CustomLabel.cs:
public class CustomLabel:Label
{
private
PointF m_refLocn;
private
FillStyle m_styleFill;
public
CustomLabel()
: base()
{
}
public
CustomLabel(CustomLabel src)
: base(src)
{
if
(src.m_styleFill != null)
m_styleFill = (FillStyle)src.m_styleFill.Clone();
}
public
CustomLabel(Node container, string strText)
: base(container,
strText)
{
}
public FillStyle FontColor
{
get
{
if
(m_styleFill == null)
{
m_styleFill = new FillStyle();
m_styleFill.Color = Color.Black;
}
return
m_styleFill;
}
}
protected
CustomLabel(SerializationInfo info, StreamingContext context)
: base(info,
context)
{
foreach
(SerializationEntry entry in info)
{
switch
(entry.Name)
{
case
"fillStyle":
m_styleFill = (FillStyle)info.GetValue("fillStyle",
typeof(FillStyle));
break;
}
}
}
protected
override void
Render(Graphics gfx)
{
this.FontColorStyle.Color
= this.FontColor.Color;
base.Render(gfx);
}
}
Here is the sample:
Please let us know if you have any queries.
Regards,
Amsath Ali. M
{
this.FontColorStyle.Color = this.FontColor.Color;
base.Render(gfx);
}
i don't have this object in my file ,Hi Prashanthi,
Thanks for your update.
Since the Version [6.0] does not contain support to change
the color of the Node’s Label, could you please upgrade to our latest version
[10.2.0.75], because the latest version has many features related to labels
like ‘Label Color, Text wrap, string alignment, etc.?
Please let us know if you have any queries.
Regards,
Amsath Ali. M