01.
[System.Drawing.ToolboxBitmap(
"c:\\stop.bmp"
)]
02.
public
class
StopSignControl:
03.
System.Windows.Forms.UserControl
04.
05.
{
06.
internal
System.Windows.Forms.Label Label1;
07.
internal
System.Windows.Forms.Button Button1;
08.
09.
public
StopSignControl() :
base
()
10.
{
11.
this
.Label1 =
new
System.Windows.Forms.Label();
12.
this
.Button1 =
new
System.Windows.Forms.Button();
13.
14.
this
.Label1.Font =
new
System.Drawing.Font(
"Microsoft Sans Serif"
, 12.0F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((
byte
) 0));
15.
16.
this
.Label1.ForeColor = System.Drawing.Color.Red;
17.
this
.Label1.Location =
new
System.Drawing.Point(24, 56);
18.
this
.Label1.Name =
"Label1"
;
19.
this
.Label1.TabIndex = 0;
20.
this
.Label1.Text =
"Stop!"
;
21.
this
.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
22.
23.
this
.Button1.Enabled =
false
;
24.
this
.Button1.Location =
new
System.Drawing.Point(56, 88);
25.
this
.Button1.Name =
"Button1"
;
26.
this
.Button1.Size =
new
System.Drawing.Size(40, 32);
27.
this
.Button1.TabIndex = 1;
28.
this
.Button1.Text =
"stop"
;
29.
30.
this
.Controls.Add(
this
.Button1);
31.
this
.Controls.Add(
this
.Label1);
32.
this
.Name =
"StopSignControl"
;
33.
34.
}
35.
36.
private
void
StopSignControl_MouseEnter(
object
sender, System.EventArgs e)
37.
{
38.
39.
Label1.Text.ToUpper();
40.
Label1.Font =
new
System.Drawing.Font(Label1.Font.FontFamily, 14.0F,
41.
System.Drawing.FontStyle.Bold);
42.
Button1.Enabled =
true
;
43.
}
44.
45.
private
void
StopSignControl_MouseLeave(
object
sender, System.EventArgs e)
46.
{
47.
48.
Label1.Text.ToLower();
49.
Label1.Font =
new
System.Drawing.Font(Label1.Font.FontFamily, 12.0F,
50.
System.Drawing.FontStyle.Regular);
51.
Button1.Enabled =
false
;
52.
}
53.
54.
}