简体   繁体   中英

How can i manipulate the Font Properties in c# on a run time

I really am new on this trying to manipulate the font property of a text or chart title in c# windows form

so far i tried this ones:

Font font = new System.Drawing.Font(FontStyle.Bold) <-- it wouldn't do debugging

Chart1.Title[0].Font = new Font(Chart1.Title[0].Font, 
Chart1.Title[0].Font.Style | FontStyle.Bold); <-- this got pass to debugging by no effect

Chart1.Title[0].Font(FontStyle.Bold); <-- so is this one pass debugging but no effect.

i got Hands up on trying to set it's text to bold in windows form i've done it but only at a web apps which pretty much simplier 要简单得多

how do i set it's propert title font to change the text to bold instead of normal fontstyle?

Try this:

   Title title = Chart1.Titles.Add("Test");
   title.Font = new System.Drawing.Font("Arial", 16, FontStyle.Bold);
   title.ForeColor = System.Drawing.Color.FromArgb(0, 0, 205);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM