A
andrerus
Hi, does anybody know a way to draw a bordered text (which each
character surrounded by a contour)?
Andrea
character surrounded by a contour)?
Andrea
Hi,
You have to create your own component inherits from label and override
the OnPaint method.
BR
Fabien Decret (Device Application Development MVP)
Windows Embedded Consultant
ADENEO (ADESET)http://www.adeneo.adetelgroup.com/|http://fabdecret.blogspot.com/
Per Fabien's recommendation, create a control and inherit from Control or
Label, override the OnPaint method and then do the drawing yourself. Here is
an example:
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
Rectange currentRectangle = new Rectangle(0, 0. base.Width, base.Height);
g.FillRectangle(new SolidBrush(base.BackColor), currentRectangle);
g.DrawString(base.Text, base.Font, 3f, ((float)base.Height -
stringSize.Height) / 2f);
currentRectangle = new Rectangle(1, 1. base.Width - 2, base.Height - 2);
g.DrawRectangle(new Pen(Color.Black, 1f), currentRectangle);
}
And you've drawn a label with a border.
Regards,
Rick D.