Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 26aec14f
由
HZH
编写于
2019-11-27 14:19:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
开关文字支持自定义颜色
1 个父辈
90b35cf9
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
30 行增加
和
5 行删除
HZH_Controls/HZH_Controls/Controls/Switch/UCSwitch.cs
HZH_Controls/HZH_Controls/HZH_Controls.nuspec
HZH_Controls/HZH_Controls/HandInput/handinput.ini
HZH_Controls/Test/UC/UCTestForms.Designer.cs
HZH_Controls/HZH_Controls/Controls/Switch/UCSwitch.cs
查看文件 @
26aec14
...
@@ -57,6 +57,18 @@ namespace HZH_Controls.Controls
...
@@ -57,6 +57,18 @@ namespace HZH_Controls.Controls
Refresh
();
Refresh
();
}
}
}
}
private
Color
m_trueTextColr
=
Color
.
White
;
[
Description
(
"选中时文本颜色"
),
Category
(
"自定义"
)]
public
Color
TrueTextColr
{
get
{
return
m_trueTextColr
;
}
set
{
m_trueTextColr
=
value
;
Refresh
();
}
}
/// <summary>
/// <summary>
/// The m false color
/// The m false color
...
@@ -78,6 +90,19 @@ namespace HZH_Controls.Controls
...
@@ -78,6 +90,19 @@ namespace HZH_Controls.Controls
}
}
}
}
private
Color
m_falseTextColr
=
Color
.
White
;
[
Description
(
"没有选中时文本颜色"
),
Category
(
"自定义"
)]
public
Color
FalseTextColr
{
get
{
return
m_falseTextColr
;
}
set
{
m_falseTextColr
=
value
;
Refresh
();
}
}
/// <summary>
/// <summary>
/// The m checked
/// The m checked
/// </summary>
/// </summary>
...
@@ -233,7 +258,7 @@ namespace HZH_Controls.Controls
...
@@ -233,7 +258,7 @@ namespace HZH_Controls.Controls
{
{
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
g
.
DrawString
(
strText
,
Font
,
Brushes
.
White
,
new
Point
((
this
.
Height
-
2
-
4
)
/
2
,
intTextY
));
g
.
DrawString
(
strText
,
Font
,
new
SolidBrush
(
m_trueTextColr
)
,
new
Point
((
this
.
Height
-
2
-
4
)
/
2
,
intTextY
));
}
}
}
}
else
else
...
@@ -247,7 +272,7 @@ namespace HZH_Controls.Controls
...
@@ -247,7 +272,7 @@ namespace HZH_Controls.Controls
{
{
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
g
.
DrawString
(
strText
,
Font
,
Brushes
.
White
,
new
Point
(
this
.
Width
-
2
-
(
this
.
Height
-
2
-
4
)
/
2
-
((
this
.
Height
-
2
-
4
)
/
2
)
/
2
-
(
int
)
sizeF
.
Width
/
2
,
intTextY
));
g
.
DrawString
(
strText
,
Font
,
new
SolidBrush
(
m_falseTextColr
)
,
new
Point
(
this
.
Width
-
2
-
(
this
.
Height
-
2
-
4
)
/
2
-
((
this
.
Height
-
2
-
4
)
/
2
)
/
2
-
(
int
)
sizeF
.
Width
/
2
,
intTextY
));
}
}
}
}
}
}
...
@@ -293,7 +318,7 @@ namespace HZH_Controls.Controls
...
@@ -293,7 +318,7 @@ namespace HZH_Controls.Controls
{
{
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
g
.
DrawString
(
strText
,
Font
,
Brushes
.
White
,
new
Point
((
this
.
Height
-
2
-
4
)
/
2
,
intTextY
));
g
.
DrawString
(
strText
,
Font
,
new
SolidBrush
(
m_trueTextColr
)
,
new
Point
((
this
.
Height
-
2
-
4
)
/
2
,
intTextY
));
}
}
}
}
else
else
...
@@ -314,7 +339,7 @@ namespace HZH_Controls.Controls
...
@@ -314,7 +339,7 @@ namespace HZH_Controls.Controls
{
{
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
int
intTextY
=
(
this
.
Height
-
(
int
)
sizeF
.
Height
)
/
2
+
2
;
g
.
DrawString
(
strText
,
Font
,
Brushes
.
White
,
new
Point
(
this
.
Width
-
2
-
(
this
.
Height
-
2
-
4
)
/
2
-
((
this
.
Height
-
2
-
4
)
/
2
)
/
2
-
(
int
)
sizeF
.
Width
/
2
,
intTextY
));
g
.
DrawString
(
strText
,
Font
,
new
SolidBrush
(
m_falseTextColr
)
,
new
Point
(
this
.
Width
-
2
-
(
this
.
Height
-
2
-
4
)
/
2
-
((
this
.
Height
-
2
-
4
)
/
2
)
/
2
-
(
int
)
sizeF
.
Width
/
2
,
intTextY
));
}
}
}
}
}
}
...
...
HZH_Controls/HZH_Controls/HZH_Controls.nuspec
查看文件 @
26aec14
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<package
>
<package
>
<metadata>
<metadata>
<id>
$id$
</id>
<id>
$id$
</id>
<version>
1.0.
9
</version>
<version>
1.0.
10
</version>
<title>
HZHControls
</title>
<title>
HZHControls
</title>
<authors>
HuangZhengHui
</authors>
<authors>
HuangZhengHui
</authors>
<owners>
HuangZhengHui
</owners>
<owners>
HuangZhengHui
</owners>
...
...
HZH_Controls/HZH_Controls/HandInput/handinput.ini
查看文件 @
26aec14
此文件类型无法预览
HZH_Controls/Test/UC/UCTestForms.Designer.cs
查看文件 @
26aec14
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论