The label control (and other controls I assume) are drawn using various text renderings depending on system settings.
This is the OnPaint method of the Label which shows what's going on. You could emulate the relevant parts in your own code. To go deeper you will need a tool such as Reflector to dig into the .NET source.
protected override void OnPaint(PaintEventArgs e)
{
Color nearestColor;
this.Animate();
Rectangle r = LayoutUtils.DeflateRect(base.ClientRectangle, base.Padding);
ImageAnimator.UpdateFrames();
Image image = this.Image;
if (image != null)
{
this.DrawImage(e.Graphics, image, r, base.RtlTranslateAlignment(this.ImageAlign));
}
IntPtr hdc = e.Graphics.GetHdc();
try
{
using (WindowsGraphics graphics = WindowsGraphics.FromHdc(hdc))
{
nearestColor = graphics.GetNearestColor(base.Enabled ? this.ForeColor : base.DisabledColor);
}
}
finally
{
e.Graphics.ReleaseHdc();
}
if (this.AutoEllipsis)
{
Rectangle clientRectangle = base.ClientRectangle;
Size preferredSize = this.GetPreferredSize(new Size(clientRectangle.Width, clientRectangle.Height));
this.showToolTip = (clientRectangle.Width < preferredSize.Width) || (clientRectangle.Height < preferredSize.Height);
}
else
{
this.showToolTip = false;
}
if (this.UseCompatibleTextRendering)
{
using (StringFormat format = this.CreateStringFormat())
{
if (base.Enabled)
{
using (Brush brush = new SolidBrush(nearestColor))
{
e.Graphics.DrawString(this.Text, this.Font, brush, r, format);
goto Label_01BF;
}
}
ControlPaint.DrawStringDisabled(e.Graphics, this.Text, this.Font, nearestColor, r, format);
goto Label_01BF;
}
}
TextFormatFlags flags = this.CreateTextFormatFlags();
if (base.Enabled)
{
TextRenderer.DrawText(e.Graphics, this.Text, this.Font, r, nearestColor, flags);
}
else
{
Color foreColor = TextRenderer.DisabledTextColor(this.BackColor);
TextRenderer.DrawText(e.Graphics, this.Text, this.Font, r, foreColor, flags);
}
Label_01BF:
base.OnPaint(e);
}