1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
static public Font BoldFont(Font font)
{
if (font != null)
{
FontStyle fontStyle = font.Style;
if ((fontStyle & FontStyle.Bold) == 0)
{
fontStyle |= FontStyle.Bold;
font = new Font(font, fontStyle);
}
else
{
fontStyle ^= FontStyle.Bold;
font = new Font(font, fontStyle);
}
}
return font;
}
static public Font ItalicFont(Font font)
{
if (font != null)
{
FontStyle fontStyle = font.Style;
if ((fontStyle & FontStyle.Italic) == 0)
{
fontStyle |= FontStyle.Italic;
font = new Font(font, fontStyle);
}
else
{
fontStyle ^= FontStyle.Italic;
font = new Font(font, fontStyle);
}
}
return font;
}
static public Font UnderlineFont(Font font)
{
if (font != null)
{
FontStyle fontStyle = font.Style;
if ((fontStyle & FontStyle.Underline) == 0)
{
fontStyle |= FontStyle.Underline ;
font = new Font(font, fontStyle);
}
else
{
fontStyle ^= FontStyle.Underline ;
font = new Font(font, fontStyle);
}
}
return font;
}
|