M
Martin
Hello All,
I've created a WinForm control and everything is OK except the look
of the font on my control.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
SizeF objTextSize = e.Graphics.MeasureString(this.Text,
this.Font);
PointF objTextPosition = new PointF(0, (this.Height -
objTextSize.Height) / 2);
e.Graphics.DrawString(this.Text, this.Font, Brushes.Black,
objTextPosition);
}
}
If I compare my Control to a Label, the text in the Label looks a lot
more sharp, beautiful, clean and clear... Why? For the same font and
size, I should have the same look. No?
What is wrong with my DrawString? Why my control text and font
doesn't have the same look and feel as a Label text and font?
Thanks for you help!
Martin
I've created a WinForm control and everything is OK except the look
of the font on my control.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
SizeF objTextSize = e.Graphics.MeasureString(this.Text,
this.Font);
PointF objTextPosition = new PointF(0, (this.Height -
objTextSize.Height) / 2);
e.Graphics.DrawString(this.Text, this.Font, Brushes.Black,
objTextPosition);
}
}
If I compare my Control to a Label, the text in the Label looks a lot
more sharp, beautiful, clean and clear... Why? For the same font and
size, I should have the same look. No?
What is wrong with my DrawString? Why my control text and font
doesn't have the same look and feel as a Label text and font?
Thanks for you help!
Martin