473,320 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

FontStyle class

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
}

Jan 30 '07 #1
1 5283

On Jan 30, 8:27 pm, xiaomi...@gmail.com wrote:
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.

Jan 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be able to check all the methods defined in B #and A,...
0
by: Dries De Rudder | last post by:
Hi, I'm creating reports using GDI in C#. The problem I'm trying to solve now is to draw a block of text of which some words are bold. How can I do that using the Graphics object. The...
1
by: OutdoorGuy | last post by:
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...
5
by: VJ | last post by:
FontStyle is a enum type .. I want to store this FontStyle as a column in datatable. when the users saves data.. and show it back when user opens the XML data... We figured how to store Font Name.....
2
by: Tiago Salgado | last post by:
I everyone... i'm having some problems when i'm trying to change a item fontstyle in a listview (details view). Code: frmMain.FeedsList.Items(CInt(id1)).Font.Style = FontStyle.Regular The...
1
by: Nathan Sokalski | last post by:
I want to create a Font object that is both Italic and Strikeout. However, in the Font constructor there is only room for one FontStyle property. How can I make my Font use more than one FontStyle...
1
by: Roger | last post by:
I know this is probably an easy question. But in VB.Net when you instantiate a fontstyle object, the parameter for fontstyle, if you wanted it to be Bold and Italic, you would enter "FontStyle.Bold...
2
by: =?Utf-8?B?UmljaA==?= | last post by:
I have code to bold text in a datagridviewcell: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim cs As DataGridViewCellStyle, fnt...
3
by: Dom | last post by:
I want to change the FontStyle in a DataGridView control. But for some reason, Font.Strikeout is read only. The only thing I can think of is to create a new Font with the Strikeout FontStyle. Is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.