Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b31801cb
由
HZH
编写于
2019-10-09 09:17:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
验证组件自动关闭
1 个父辈
1a875382
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
70 行增加
和
3 行删除
HZH_Controls/HZH_Controls/Controls/Verification/VerificationComponent.cs
HZH_Controls/HZH_Controls/HZH_Controls.nuspec
HZH_Controls/HZH_Controls/Controls/Verification/VerificationComponent.cs
查看文件 @
b31801c
...
...
@@ -103,6 +103,20 @@ namespace HZH_Controls.Controls
set
{
errorTipsForeColor
=
value
;
}
}
private
int
autoCloseErrorTipsTime
=
3000
;
[
Browsable
(
true
),
Category
(
"自定义属性"
),
Description
(
"自动关闭提示事件,当值为0时不自动关闭"
),
Localizable
(
true
)]
public
int
AutoCloseErrorTipsTime
{
get
{
return
autoCloseErrorTipsTime
;
}
set
{
if
(
value
<
0
)
return
;
autoCloseErrorTipsTime
=
value
;
}
}
#
region
构造函数
English
:
Constructor
/// <summary>
/// Initializes a new instance of the <see cref="VerificationComponent"/> class.
...
...
@@ -438,11 +452,64 @@ namespace HZH_Controls.Controls
}
else
{
var
tips
=
Forms
.
FrmAnchorTips
.
ShowTips
(
e
.
VerificationControl
,
e
.
ErrorMsg
,
background
:
errorTipsBackColor
,
foreColor
:
errorTipsForeColor
,
autoCloseTime
:
0
,
blnTopMost
:
false
);
var
tips
=
Forms
.
FrmAnchorTips
.
ShowTips
(
e
.
VerificationControl
,
e
.
ErrorMsg
,
background
:
errorTipsBackColor
,
foreColor
:
errorTipsForeColor
,
autoCloseTime
:
autoCloseErrorTipsTime
,
blnTopMost
:
false
);
tips
.
FormClosing
+=
tips_FormClosing
;
m_controlTips
[
e
.
VerificationControl
]
=
tips
;
}
}
}
#
endregion
void
tips_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
foreach
(
var
item
in
m_controlTips
)
{
if
(
item
.
Value
==
sender
)
{
m_controlTips
.
Remove
(
item
.
Key
);
break
;
}
}
}
#
endregion
/// <summary>
/// 关闭所有错误提示
/// </summary>
public
void
CloseErrorTips
()
{
for
(
int
i
=
0
;
i
<
1
;
)
{
try
{
foreach
(
var
item
in
m_controlTips
)
{
if
(
item
.
Value
!=
null
&&
!
item
.
Value
.
IsDisposed
)
{
item
.
Value
.
Close
();
}
}
}
catch
{
continue
;
}
i
++;
}
m_controlTips
.
Clear
();
}
/// <summary>
/// 关闭指定验证控件的提示
/// </summary>
/// <param name="verificationControl">验证控件.</param>
public
void
CloseErrorTips
(
Control
verificationControl
)
{
if
(
m_controlTips
.
ContainsKey
(
verificationControl
))
{
if
(
m_controlTips
[
verificationControl
]
!=
null
&&
!
m_controlTips
[
verificationControl
].
IsDisposed
)
{
m_controlTips
[
verificationControl
].
Close
();
}
}
}
}
}
HZH_Controls/HZH_Controls/HZH_Controls.nuspec
查看文件 @
b31801c
...
...
@@ -2,7 +2,7 @@
<package
>
<metadata>
<id>
$id$
</id>
<version>
1.0.
6
</version>
<version>
1.0.
7
</version>
<title>
HZHControls
</title>
<authors>
HuangZhengHui
</authors>
<owners>
HuangZhengHui
</owners>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论