Font for Bold label in C #

Source: Internet
Author: User

1. In C # code, you want to directly add the font of the label control,

Label1. Font.Bold = true;//Discovery System will prompt Font.Bold is a read-only property

If you have to add a bold font, here's how:

2. Use the different construction methods of the font:

Bold, and add underline Label1. Font = new Font (Label1. Font.Name, FontStyle.Bold | Fontstyle.underline);

Using VS you can see that there are many overloads to the font's construction method, and we're using this method:

/** * The first parameter is: the name of the font * The second argument is: the size of the font * The third parameter is the style of the font, and the "|" is used between multiple styles Separate */public Font (string familyname, float emSize, fontstyle style);

  

Font for Bold label in C #

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.