FontStyle Question

  • Thread starter Thread starter OutdoorGuy
  • Start date Start date
O

OutdoorGuy

Greetings,

I am attempting to use the code below to print information on a Windows
form. The code itself is working fine, but I simply want to change the
font of the label to be both Bold and Italic. However, when I add
"FontStyle.Italic" after "FontStyle.Bold" (in the "using" statement), I
receive an error. Any idea as to how to accomplish this?

Thanks in advance!

Code:

private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
float xpos, ypos;
float lineheight = 50;
using (Font f = new Font("Arial", 24, FontStyle.Bold))
{
xpos = e.MarginBounds.Left;
ypos = e.MarginBounds.Top;
e.Graphics.DrawString("Customer form", f,
Brushes.Black, xpos, ypos);
}
....
....
 
Back
Top