-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextStyle.cs
50 lines (43 loc) · 1.04 KB
/
TextStyle.cs
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
using System.ComponentModel;
using System.Drawing;
namespace SuperPerformanceChart
{
[TypeConverter(typeof(ExpandableObjectConverter))]
public class TextStyle
{
private SolidBrush _brush;
private Font m_font;
public TextStyle(Color oColor)
{
_brush = new SolidBrush(oColor);
m_font = new Font(System.Windows.Forms.SystemInformation.MenuFont.Name, 8, FontStyle.Regular);
}
public Font Font
{
get
{
return m_font;
}
set
{
m_font.Dispose();
m_font = value;
}
}
[Browsable(false)]
public SolidBrush Brush { get => _brush; }
public Color Color
{
get
{
return _brush.Color;
}
set
{
// recreate these
_brush.Dispose();
_brush = new SolidBrush(value);
}
}
}
}