Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cf4e27be
由
HZH
编写于
2019-08-19 09:11:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
步骤控件支持完成图标
1 个父辈
d6a33173
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
78 行增加
和
20 行删除
HZH_Controls/HZH_Controls/Controls/Step/UCStep.cs
HZH_Controls/Test/Form2.Designer.cs
HZH_Controls/HZH_Controls/Controls/Step/UCStep.cs
查看文件 @
cf4e27b
...
...
@@ -24,7 +24,11 @@ namespace HZH_Controls.Controls
public
Color
StepBackColor
{
get
{
return
m_stepBackColor
;
}
set
{
m_stepBackColor
=
value
;
}
set
{
m_stepBackColor
=
value
;
Refresh
();
}
}
private
Color
m_stepForeColor
=
Color
.
FromArgb
(
255
,
85
,
51
);
...
...
@@ -35,7 +39,11 @@ namespace HZH_Controls.Controls
public
Color
StepForeColor
{
get
{
return
m_stepForeColor
;
}
set
{
m_stepForeColor
=
value
;
}
set
{
m_stepForeColor
=
value
;
Refresh
();
}
}
private
Color
m_stepFontColor
=
Color
.
White
;
...
...
@@ -46,7 +54,11 @@ namespace HZH_Controls.Controls
public
Color
StepFontColor
{
get
{
return
m_stepFontColor
;
}
set
{
m_stepFontColor
=
value
;
}
set
{
m_stepFontColor
=
value
;
Refresh
();
}
}
private
int
m_stepWidth
=
35
;
...
...
@@ -57,7 +69,11 @@ namespace HZH_Controls.Controls
public
int
StepWidth
{
get
{
return
m_stepWidth
;
}
set
{
m_stepWidth
=
value
;
}
set
{
m_stepWidth
=
value
;
Refresh
();
}
}
private
string
[]
m_steps
=
new
string
[]
{
"step1"
,
"step2"
,
"step3"
};
...
...
@@ -94,6 +110,33 @@ namespace HZH_Controls.Controls
}
}
private
int
m_lineWidth
=
2
;
[
Description
(
"连接线宽度,最小2"
),
Category
(
"自定义"
)]
public
int
LineWidth
{
get
{
return
m_lineWidth
;
}
set
{
if
(
value
<
2
)
return
;
m_lineWidth
=
value
;
Refresh
();
}
}
private
Image
m_imgCompleted
=
null
;
[
Description
(
"已完成步骤图片,当不为空时,已完成步骤将不再显示数字"
),
Category
(
"自定义"
)]
public
Image
ImgCompleted
{
get
{
return
m_imgCompleted
;
}
set
{
m_imgCompleted
=
value
;
Refresh
();
}
}
public
UCStep
()
{
InitializeComponent
();
...
...
@@ -148,16 +191,36 @@ namespace HZH_Controls.Controls
{
g
.
FillEllipse
(
new
SolidBrush
(
m_stepForeColor
),
new
Rectangle
(
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
2
,
y
+
2
),
new
Size
(
m_stepWidth
-
4
,
m_stepWidth
-
4
)));
}
if
(
m_stepIndex
>
i
&&
m_imgCompleted
!=
null
)
{
g
.
DrawImage
(
m_imgCompleted
,
new
Rectangle
(
new
Point
((
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
(
m_stepWidth
-
24
)
/
2
),
y
+
(
m_stepWidth
-
24
)
/
2
),
new
Size
(
24
,
24
)),
0
,
0
,
m_imgCompleted
.
Width
,
m_imgCompleted
.
Height
,
GraphicsUnit
.
Pixel
,
null
);
}
else
{
System
.
Drawing
.
SizeF
_numSize
=
g
.
MeasureString
((
i
+
1
).
ToString
(),
this
.
Font
);
g
.
DrawString
((
i
+
1
).
ToString
(),
Font
,
new
SolidBrush
(
m_stepFontColor
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
(
m_stepWidth
-
(
int
)
_numSize
.
Width
)
/
2
+
1
,
y
+
(
m_stepWidth
-
(
int
)
_numSize
.
Height
)
/
2
+
1
));
}
#
endregion
System
.
Drawing
.
SizeF
sizeTxt
=
g
.
MeasureString
(
m_steps
[
i
],
this
.
Font
);
g
.
DrawString
(
m_steps
[
i
],
Font
,
new
SolidBrush
(
m_stepIndex
>
i
?
m_stepForeColor
:
m_stepBackColor
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
(
m_stepWidth
-
(
int
)
sizeTxt
.
Width
)
/
2
+
1
,
intTxtY
));
}
for
(
int
i
=
0
;
i
<
m_steps
.
Length
;
i
++)
{
if
(
m_stepIndex
>
i
)
{
if
(
i
!=
m_steps
.
Length
-
1
)
{
if
(
m_stepIndex
==
i
+
1
)
{
g
.
DrawLine
(
new
Pen
(
m_stepForeColor
,
2
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
-
3
,
y
+
(
m_stepWidth
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
)
-
intSplitWidth
/
2
,
y
+
(
m_stepWidth
/
2
)));
g
.
DrawLine
(
new
Pen
(
m_stepBackColor
,
2
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
+
intSplitWidth
/
2
,
y
+
(
m_stepWidth
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
),
y
+
(
m_stepWidth
/
2
)));
g
.
DrawLine
(
new
Pen
(
m_stepForeColor
,
m_lineWidth
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
-
3
,
y
+
((
m_stepWidth
)
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
)
-
intSplitWidth
/
2
,
y
+
((
m_stepWidth
)
/
2
)));
g
.
DrawLine
(
new
Pen
(
m_stepBackColor
,
m_lineWidth
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
+
intSplitWidth
/
2
,
y
+
((
m_stepWidth
)
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
)
+
3
,
y
+
((
m_stepWidth
)
/
2
)));
}
else
{
g
.
DrawLine
(
new
Pen
(
m_stepForeColor
,
2
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
-
3
,
y
+
(
m_stepWidth
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
),
y
+
(
m_stepWidth
/
2
)));
g
.
DrawLine
(
new
Pen
(
m_stepForeColor
,
m_lineWidth
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
-
3
,
y
+
((
m_stepWidth
)
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
)
+
3
,
y
+
((
m_stepWidth
)
/
2
)));
}
}
}
...
...
@@ -165,16 +228,9 @@ namespace HZH_Controls.Controls
{
if
(
i
!=
m_steps
.
Length
-
1
)
{
g
.
DrawLine
(
new
Pen
(
m_stepBackColor
,
2
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
-
3
,
y
+
(
m_stepWidth
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
),
y
+
(
m_stepWidth
/
2
)));
g
.
DrawLine
(
new
Pen
(
m_stepBackColor
,
m_lineWidth
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
m_stepWidth
-
3
,
y
+
((
m_stepWidth
)
/
2
)),
new
Point
((
i
+
1
)
*
(
m_stepWidth
+
intSplitWidth
)
+
3
,
y
+
((
m_stepWidth
)
/
2
)));
}
}
System
.
Drawing
.
SizeF
_numSize
=
g
.
MeasureString
((
i
+
1
).
ToString
(),
this
.
Font
);
g
.
DrawString
((
i
+
1
).
ToString
(),
Font
,
new
SolidBrush
(
m_stepFontColor
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
(
m_stepWidth
-
(
int
)
_numSize
.
Width
)
/
2
+
1
,
y
+
(
m_stepWidth
-
(
int
)
_numSize
.
Height
)
/
2
+
1
));
#
endregion
System
.
Drawing
.
SizeF
sizeTxt
=
g
.
MeasureString
(
m_steps
[
i
],
this
.
Font
);
g
.
DrawString
(
m_steps
[
i
],
Font
,
new
SolidBrush
(
m_stepIndex
>
i
?
m_stepForeColor
:
m_stepBackColor
),
new
Point
(
intLeft
+
i
*
(
m_stepWidth
+
intSplitWidth
)
+
(
m_stepWidth
-
(
int
)
sizeTxt
.
Width
)
/
2
+
1
,
intTxtY
));
}
}
...
...
HZH_Controls/Test/Form2.Designer.cs
查看文件 @
cf4e27b
...
...
@@ -45,7 +45,7 @@
this
.
ucProcessEllipse1
.
BackEllipseColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
22
)))),
((
int
)(((
byte
)(
160
)))),
((
int
)(((
byte
)(
133
)))));
this
.
ucProcessEllipse1
.
CoreEllipseColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
180
)))),
((
int
)(((
byte
)(
180
)))),
((
int
)(((
byte
)(
180
)))));
this
.
ucProcessEllipse1
.
IsShowCoreEllipseBorder
=
true
;
this
.
ucProcessEllipse1
.
Location
=
new
System
.
Drawing
.
Point
(
78
,
117
);
this
.
ucProcessEllipse1
.
Location
=
new
System
.
Drawing
.
Point
(
90
,
288
);
this
.
ucProcessEllipse1
.
MaxValue
=
100
;
this
.
ucProcessEllipse1
.
Name
=
"ucProcessEllipse1"
;
this
.
ucProcessEllipse1
.
ShowType
=
HZH_Controls
.
Controls
.
ShowType
.
Ring
;
...
...
@@ -78,20 +78,22 @@
// ucStep1
//
this
.
ucStep1
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
ucStep1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
);
this
.
ucStep1
.
LineWidth
=
10
;
this
.
ucStep1
.
Location
=
new
System
.
Drawing
.
Point
(
12
,
12
);
this
.
ucStep1
.
Name
=
"ucStep1"
;
this
.
ucStep1
.
Size
=
new
System
.
Drawing
.
Size
(
36
1
,
76
);
this
.
ucStep1
.
Size
=
new
System
.
Drawing
.
Size
(
36
0
,
172
);
this
.
ucStep1
.
StepBackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
100
)))),
((
int
)(((
byte
)(
100
)))),
((
int
)(((
byte
)(
100
)))));
this
.
ucStep1
.
StepFontColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucStep1
.
StepForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
255
)))),
((
int
)(((
byte
)(
85
)))),
((
int
)(((
byte
)(
51
)))));
this
.
ucStep1
.
StepIndex
=
1
;
this
.
ucStep1
.
StepForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
100
)))),
((
int
)(((
byte
)(
184
)))),
((
int
)(((
byte
)(
255
)))));
this
.
ucStep1
.
StepIndex
=
2
;
this
.
ucStep1
.
Steps
=
new
string
[]
{
"step1"
,
"step2"
,
"step3"
,
"step4"
,
"step5"
};
this
.
ucStep1
.
StepWidth
=
35
;
this
.
ucStep1
.
StepWidth
=
50
;
this
.
ucStep1
.
TabIndex
=
0
;
//
// Form2
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论