Nicholas,
Here is what I have pieced together so far. My problem is that I see both
the text that was set in the label1.Text property, as well as my formatted
text. I cant figure out how to get rid of the previous text as setting the
label1.Text property = ""; erases all text.
private void SmoothingFonts_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Label lbl = (Label)sender;
Font TextFont = new Font("Arial", 12, FontStyle.Regular);
e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
int height = lbl.Size.Height + 20;
int width = lbl.Size.Width + 500;
Size size = new Size(width, height);
Rectangle rect = new Rectangle(lbl.Location, size);
e.Graphics.DrawString(lbl.Text, TextFont, Brushes.White,
lbl.ClientRectangle);
}
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:9B**********************************@microsof t.com...
Ron,
What is the call to DrawString that you are making? Are you setting
the TextRenderingHint property on the Graphics instance you are using to
draw to the form?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"RSH" <wa*************@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>>I have been experimenting with overriding the Paint event on Win Form
controls...more specifically trying to force the text to render as
Antialiased text. I have not been successful in any of the methods Ive
tried...is there a trick? Any information or examples would be greatly
appreciated.
Thanks!
Ron