When you draw the text you need to set the TextRenderingHint of the Graphics
object to SingleBitPerPixel which ought to stop that problem.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
> I created a transparent form, but the text in my label has a black border
> around it.
[quoted text clipped - 26 lines]
>
> Matthew
Matthew - 17 Oct 2004 17:38 GMT
> When you draw the text you need to set the TextRenderingHint of the
> Graphics
> object to SingleBitPerPixel which ought to stop that problem.
Bob, thanks for the response. That's exactly what it wanted!
I had a bit of trouble figuring out how to apply it to the label, then I
realized I didn't have to!
I hid my Label1 and put the following in my form's paint event:
e.Graphics.TextRenderingHint = _
e.Graphics.TextRenderingHint.SingleBitPerPixel
e.Graphics.DrawString(Label1.Text, Label1.Font, _
New SolidBrush(Label1.ForeColor), New PointF(0, 0))
If there's a better way, please let me know. Otherwise, I am thrilled with
the result.
Thanks again!
Matthew