473,320 Members | 1,916 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.

How to transform a font into bold ?

Hi,

I have a C# font instance. I would like to instanciate a font equal to this
one but with the bold attribute. What is the shortest way to create the
second one from the first one ?

Thank you

Herve
Nov 16 '05 #1
3 15005
Create a new font from the current font:
Font font = new Font(...);
// Variant instantation, use the current font as the prototype, only
changing the font style.
font = new Font(font, FontStyle.Bold);
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Herve Bocuse" <gd******@gmail.com> wrote in message
news:cp**********@dns3.cae.ca...
Hi,

I have a C# font instance. I would like to instanciate a font equal to
this
one but with the bold attribute. What is the shortest way to create the
second one from the first one ?

Thank you

Herve

Nov 16 '05 #2
Hi,

You can clone the existing font object and use the property FontStyle.Bold
to set the font to bold.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Herve Bocuse" <gd******@gmail.com> je napisal v sporoèilo
news:cp**********@dns3.cae.ca ...
Hi,

I have a C# font instance. I would like to instanciate a font equal to
this
one but with the bold attribute. What is the shortest way to create the
second one from the first one ?

Thank you

Herve

Nov 16 '05 #3
So easy, thank you.

"Dennis Myrén" <de****@oslokb.no> wrote in message
news:fL********************@news2.e.nsc.no...
Create a new font from the current font:
Font font = new Font(...);
// Variant instantation, use the current font as the prototype, only
changing the font style.
font = new Font(font, FontStyle.Bold);
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Herve Bocuse" <gd******@gmail.com> wrote in message
news:cp**********@dns3.cae.ca...
Hi,

I have a C# font instance. I would like to instanciate a font equal to
this
one but with the bold attribute. What is the shortest way to create the
second one from the first one ?

Thank you

Herve


Nov 16 '05 #4

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

Similar topics

0
by: Wilfredo Perez | last post by:
I made a form and it also has a chekbox, when I check the box the font goes to bold which is good, but when I go to print it, but it comes out with the text not in bold
1
by: freddy | last post by:
I am new to c#. I would like to set the text in a combobox to bold if the user check off a radiobtn something like thi if radiobtn = true the combobox.font = new combobox.font.bol I know this is...
1
by: Marty | last post by:
Is there a way to set textbox font to bold at runtime? Thanks.
4
by: anthony | last post by:
hi, why can't i set the font of a button to bold at run time (it's read only), i can only set at design time. it can be done in vb6. thx
0
by: Altemir | last post by:
I have a datagrid in an .aspx page that contains some columns using the "Font=Bold" inline style. The problem is that some users' browsers aren't displaying the bold font while others are. We...
3
by: Lou | last post by:
Why is font bold a read only property. I create a new label control and want to set the font properties. How do I set the font properties of a newly created label control? lbl = New Label ...
2
by: Ben | last post by:
Hi I am having problems making a single node's Font Bold. objUserTree.Nodes.Item(i) I am looping though the items but with every property I try it fails. Thanks
2
by: Rick | last post by:
VS.2005 I inadvertently changed some setting and now all the toolbox controls that I drag onto a windows form are in font bold. Irratating! Can someone tell me the setting that controls...
1
by: yaksandcows | last post by:
I've just begun developing my first ASP .NET website using VWD2008 with VB. I am querying an SQL database to fill a gridview. If the text displayed in a gridview cell = a certain value contained...
0
nicebasic
by: nicebasic | last post by:
I'm trying to find a new feature for MSFlexGrid. As you know, we can change the BackColor of the Currently Selected Row(s) in MSFlexGrid at design time or at runtime. To change its BackColor at...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.