namespace Wnd public partial class ButtonTextBox UserControl Browsable

 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
namespace Wnd
{
public partial class ButtonTextBox : UserControl
{
[Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public event EventHandler ButtonClick;
[DefaultValue(false)]
public bool ReadOnly
{
get { return _ReadOnly; }
set
{
_ReadOnly = value;
OnReadOnlyChanged();
}
}
private bool _ReadOnly;
public ButtonTextBox()
{
InitializeComponent();
}
private void btnButton_Click(object sender, EventArgs e)
{
ButtonClick(sender, e);
}
protected virtual void OnReadOnlyChanged()
{
if (this.ReadOnly)
{
this.txtText.BackColor = Color.FromKnownColor(KnownColor.Info);
}
}
}
}