forked from 0000duck/VisionEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCRadioBox.cs
More file actions
75 lines (70 loc) · 1.75 KB
/
CRadioBox.cs
File metadata and controls
75 lines (70 loc) · 1.75 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Properties;
namespace Controls
{
public partial class CRadioBox : UserControl
{
public CRadioBox()
{
InitializeComponent();
ckb_box.Text = TextStr;
}
/// <summary>
/// 状态改变事件
/// </summary>
public event DCheckChanged CheckChanged;
/// <summary>
/// 勾选状态
/// </summary>
private bool _checked = false;
public bool Checked
{
get { return _checked; }
set
{
_checked = value;
ckb_box.Checked = value;
}
}
/// <summary>
/// 文本
/// </summary>
private string _textStr = "复选框";
public string TextStr
{
get { return _textStr; }
set
{
_textStr = value;
ckb_box.Text = value;
}
}
private void pic_image_Click(object sender, EventArgs e)
{
ckb_box.Checked = !ckb_box.Checked;
}
private void ckb_box_CheckedChanged(object sender, EventArgs e)
{
if (ckb_box.Checked)
{
pic_image.Image = Resources.勾选;
Checked = true;
}
else
{
pic_image.Image = Resources.去勾选;
Checked = false;
}
if (CheckChanged != null)
CheckChanged(ckb_box.Checked);
}
}
}