FontStyle class

  • Thread starter Thread starter xiaomitao
  • Start date Start date
X

xiaomitao

Hi all,

I am having this error, Font 'Aharoni' does not support style
'Regular'.

In my codes, i try to catch the exception but seems like it is not
catching it. Any idea why?

How can i set my style to no style too?
Appreciate any help

try
{
switch (ss.Style)
{
case 1:
style = FontStyle.Bold;
break;
case 2:
style = FontStyle.Italic;
break;
case 3:
style = FontStyle.Italic |
FontStyle.Bold;
break;
default:
style = FontStyle.Regular;
break;
}
}
catch (Exception ex)
{
Console.Error.WriteLine("No style used for
text.\n{0}", ex.Message);
//style=default; //set to no style
}
 
Hi all,

I am having this error, Font 'Aharoni' does not support style
'Regular'.

In my codes, i try to catch the exception but seems like it is not
catching it. Any idea why?

How can i set my style to no style too?
Appreciate any help

try
{
switch (ss.Style)
{
case 1:
style = FontStyle.Bold;
break;
case 2:
style = FontStyle.Italic;
break;
case 3:
style = FontStyle.Italic |
FontStyle.Bold;
break;
default:
style = FontStyle.Regular;
break;
}
}
catch (Exception ex)
{
Console.Error.WriteLine("No style used for
text.\n{0}", ex.Message);
//style=default; //set to no style
}

stupid me

i was catching the exception at the wrong place..
sorry for the post.
 

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

Back
Top