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.PaintEven tArgs e)
{
Label lbl = (Label)sender;
Font TextFont = new Font("Arial", 12, FontStyle.Regul ar);
e.Graphics.Text RenderingHint = TextRenderingHi nt.AntiAlias;
int height = lbl.Size.Height + 20;
int width = lbl.Size.Width + 500;
Size size = new Size(width, height);
Rectangle rect = new Rectangle(lbl.L ocation, size);
e.Graphics.Draw String(lbl.Text , TextFont, Brushes.White,
lbl.ClientRecta ngle);
}
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:9B******** *************** ***********@mic rosoft.com...
Ron,
What is the call to DrawString that you are making? Are you setting
the TextRenderingHi nt property on the Graphics instance you are using to
draw to the form?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"RSH" <wa************ *@yahoo.comwrot e in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>>I have been experimenting with overriding the Paint event on Win Form
controls...mo re 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