FontStyle Question

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);
}
....
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top