Shadowed Label
Hi, everyone
I'd like to know how to make label's text - shadowed.
Thanks in advance ;-)
Allon
I'd like to know how to make label's text - shadowed.
Thanks in advance ;-)
Allon
SIGN IN To post a reply.
5 Replies
MJ
Mano J
Syncfusion Team
September 14, 2009 04:53 AM UTC
Hi Allon,
You can handle label's paint event and draw the string.
Regards,
Mano
You can handle label's paint event and draw the string.
private void label1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawString(label1.Text, label1.Font, new SolidBrush(Color.Gray), 1, 1);
e.Graphics.DrawString(label1.Text, label1.Font, new SolidBrush(label1.ForeColor), 0, 0);
}
Regards,
Mano
AL
Allon
September 14, 2009 06:17 AM UTC
Hi, Mano
Thanks for your example. It works perfect.
I'd like to know how to do the same thing, without changing the location of the Label1.Text (when the Label1.Text is in the middle of the label, for example). I hope It's something simple and it's not depending on calculations depend on Label1.Text location. If it is the only way to do it, then it will be very helpful to know the location of the Label1.Text within the label control.
Thanks in advance :)
Allon
Thanks for your example. It works perfect.
I'd like to know how to do the same thing, without changing the location of the Label1.Text (when the Label1.Text is in the middle of the label, for example). I hope It's something simple and it's not depending on calculations depend on Label1.Text location. If it is the only way to do it, then it will be very helpful to know the location of the Label1.Text within the label control.
Thanks in advance :)
Allon
NR
Nandakumar R
Syncfusion Team
September 14, 2009 07:14 AM UTC
Hi Allon,
Please refer to the MyLabel class implementation in the Form1 in the attached sample. With this you can give Shadow Text to your label at any alignment.
Please change the ShadowColor property of the class to change the shadow color in rendering.
http://www.syncfusion.com/uploads/redirect.aspx?file=ShadowLabel_1f92e198.zip&team=support
Regards,
Nanda
Please refer to the MyLabel class implementation in the Form1 in the attached sample. With this you can give Shadow Text to your label at any alignment.
Please change the ShadowColor property of the class to change the shadow color in rendering.
http://www.syncfusion.com/uploads/redirect.aspx?file=ShadowLabel_1f92e198.zip&team=support
Regards,
Nanda
AL
Allon
September 14, 2009 09:09 AM UTC
Nanda, thanks a lot. It works absolutely fine.
Regards,
Allon
Regards,
Allon
NR
Nandakumar R
Syncfusion Team
September 14, 2009 09:10 AM UTC
Hi Allon,
Thanks for the update.
Regards,
Nanda
Thanks for the update.
Regards,
Nanda
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
AL Allon
- Sep 13, 2009 08:50 AM UTC
- Sep 14, 2009 09:10 AM UTC