Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ac820258
由
HZH
编写于
2019-11-22 17:02:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
鼠标效果
1 个父辈
ebf3ac4d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
75 行增加
和
5 行删除
HZH_Controls/HZH_Controls/Controls/Btn/UCBtnExt.cs
HZH_Controls/HZH_Controls/HZH_Controls.nuspec
HZH_Controls/Test/UC/UCTestBtns.Designer.cs
HZH_Controls/Test/UC/UCTestBtns.cs
HZH_Controls/Test/UC/UCTestBtns.resx
HZH_Controls/Test/UC/UCTestGridTable.cs
HZH_Controls/HZH_Controls/Controls/Btn/UCBtnExt.cs
查看文件 @
ac82025
...
@@ -35,6 +35,14 @@ namespace HZH_Controls.Controls
...
@@ -35,6 +35,14 @@ namespace HZH_Controls.Controls
public
partial
class
UCBtnExt
:
UCControlBase
public
partial
class
UCBtnExt
:
UCControlBase
{
{
#
region
字段属性
#
region
字段属性
private
bool
enabledMouseEffect
=
true
;
[
Description
(
"是否启用鼠标效果"
),
Category
(
"自定义"
)]
public
bool
EnabledMouseEffect
{
get
{
return
enabledMouseEffect
;
}
set
{
enabledMouseEffect
=
value
;
}
}
/// <summary>
/// <summary>
/// 是否显示角标
/// 是否显示角标
/// </summary>
/// </summary>
...
@@ -164,6 +172,10 @@ namespace HZH_Controls.Controls
...
@@ -164,6 +172,10 @@ namespace HZH_Controls.Controls
get
{
return
m_tipsColor
;
}
get
{
return
m_tipsColor
;
}
set
{
m_tipsColor
=
value
;
}
set
{
m_tipsColor
=
value
;
}
}
}
[
Description
(
"鼠标效果生效时发生,需要和MouseEffected同时使用,否则无效"
),
Category
(
"自定义"
)]
public
event
EventHandler
MouseEffecting
;
[
Description
(
"鼠标效果结束时发生,需要和MouseEffecting同时使用,否则无效"
),
Category
(
"自定义"
)]
public
event
EventHandler
MouseEffected
;
#
endregion
#
endregion
/// <summary>
/// <summary>
/// Initializes a new instance of the <see cref="UCBtnExt" /> class.
/// Initializes a new instance of the <see cref="UCBtnExt" /> class.
...
@@ -173,6 +185,46 @@ namespace HZH_Controls.Controls
...
@@ -173,6 +185,46 @@ namespace HZH_Controls.Controls
InitializeComponent
();
InitializeComponent
();
this
.
TabStop
=
false
;
this
.
TabStop
=
false
;
lblTips
.
Paint
+=
lblTips_Paint
;
lblTips
.
Paint
+=
lblTips_Paint
;
this
.
lbl
.
MouseEnter
+=
lbl_MouseEnter
;
this
.
lbl
.
MouseLeave
+=
lbl_MouseLeave
;
}
Color
m_cacheColor
=
Color
.
Empty
;
void
lbl_MouseLeave
(
object
sender
,
EventArgs
e
)
{
if
(
enabledMouseEffect
)
{
if
(
MouseEffecting
!=
null
&&
MouseEffected
!=
null
)
{
MouseEffected
(
this
,
e
);
}
else
{
if
(
m_cacheColor
!=
Color
.
Empty
)
{
this
.
FillColor
=
m_cacheColor
;
m_cacheColor
=
Color
.
Empty
;
}
}
}
}
void
lbl_MouseEnter
(
object
sender
,
EventArgs
e
)
{
if
(
enabledMouseEffect
)
{
if
(
MouseEffecting
!=
null
&&
MouseEffected
!=
null
)
{
MouseEffecting
(
this
,
e
);
}
else
{
if
(
FillColor
!=
Color
.
Empty
&&
FillColor
!=
null
)
{
m_cacheColor
=
this
.
FillColor
;
this
.
FillColor
=
Color
.
FromArgb
(
230
,
this
.
FillColor
);
}
}
}
}
}
/// <summary>
/// <summary>
...
...
HZH_Controls/HZH_Controls/HZH_Controls.nuspec
查看文件 @
ac82025
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<package
>
<package
>
<metadata>
<metadata>
<id>
$id$
</id>
<id>
$id$
</id>
<version>
1.0.
8
</version>
<version>
1.0.
9
</version>
<title>
HZHControls
</title>
<title>
HZHControls
</title>
<authors>
HuangZhengHui
</authors>
<authors>
HuangZhengHui
</authors>
<owners>
HuangZhengHui
</owners>
<owners>
HuangZhengHui
</owners>
...
...
HZH_Controls/Test/UC/UCTestBtns.Designer.cs
查看文件 @
ac82025
此文件的差异被折叠,
点击展开。
HZH_Controls/Test/UC/UCTestBtns.cs
查看文件 @
ac82025
...
@@ -24,5 +24,23 @@ namespace Test.UC
...
@@ -24,5 +24,23 @@ namespace Test.UC
ucBtnsGroup2
.
DataSource
=
new
Dictionary
<
string
,
string
>()
{
{
"1"
,
"河南"
},
{
"2"
,
"北京"
},
{
"3"
,
"湖南"
},
{
"4"
,
"上海"
}
};
ucBtnsGroup2
.
DataSource
=
new
Dictionary
<
string
,
string
>()
{
{
"1"
,
"河南"
},
{
"2"
,
"北京"
},
{
"3"
,
"湖南"
},
{
"4"
,
"上海"
}
};
ucBtnsGroup2
.
SelectItem
=
new
List
<
string
>()
{
"2"
,
"3"
};
ucBtnsGroup2
.
SelectItem
=
new
List
<
string
>()
{
"2"
,
"3"
};
}
}
Color
m_cacheColor
=
Color
.
Empty
;
private
void
ucBtnImg1_MouseEffected
(
object
sender
,
EventArgs
e
)
{
var
btn
=
sender
as
HZH_Controls
.
Controls
.
UCBtnExt
;
if
(
m_cacheColor
!=
Color
.
Empty
)
{
btn
.
FillColor
=
m_cacheColor
;
m_cacheColor
=
Color
.
Empty
;
}
}
private
void
ucBtnImg1_MouseEffecting
(
object
sender
,
EventArgs
e
)
{
var
btn
=
sender
as
HZH_Controls
.
Controls
.
UCBtnExt
;
m_cacheColor
=
btn
.
FillColor
;
btn
.
FillColor
=
Color
.
Red
;
}
}
}
}
}
HZH_Controls/Test/UC/UCTestBtns.resx
查看文件 @
ac82025
此文件的差异被折叠,
点击展开。
HZH_Controls/Test/UC/UCTestGridTable.cs
查看文件 @
ac82025
...
@@ -23,10 +23,10 @@ namespace Test.UC
...
@@ -23,10 +23,10 @@ namespace Test.UC
{
{
List
<
DataGridViewColumnEntity
>
lstCulumns
=
new
List
<
DataGridViewColumnEntity
>();
List
<
DataGridViewColumnEntity
>
lstCulumns
=
new
List
<
DataGridViewColumnEntity
>();
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"ID"
,
HeadText
=
"编号"
,
Width
=
70
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"ID"
,
HeadText
=
"编号"
,
Width
=
70
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Name"
,
HeadText
=
"姓名"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Name"
,
HeadText
=
"姓名"
,
Width
=
100
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Age"
,
HeadText
=
"年龄"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Age"
,
HeadText
=
"年龄"
,
Width
=
50
0
,
WidthType
=
SizeType
.
Absolute
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Birthday"
,
HeadText
=
"生日"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
,
Format
=
(
a
)
=>
{
return
((
DateTime
)
a
).
ToString
(
"yyyy-MM-dd"
);
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Birthday"
,
HeadText
=
"生日"
,
Width
=
50
0
,
WidthType
=
SizeType
.
Absolute
,
Format
=
(
a
)
=>
{
return
((
DateTime
)
a
).
ToString
(
"yyyy-MM-dd"
);
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Sex"
,
HeadText
=
"性别"
,
Width
=
50
,
WidthType
=
SizeType
.
Percent
,
Format
=
(
a
)
=>
{
return
((
int
)
a
)
==
0
?
"女"
:
"男"
;
}
});
lstCulumns
.
Add
(
new
DataGridViewColumnEntity
()
{
DataField
=
"Sex"
,
HeadText
=
"性别"
,
Width
=
50
0
,
WidthType
=
SizeType
.
Absolute
,
Format
=
(
a
)
=>
{
return
((
int
)
a
)
==
0
?
"女"
:
"男"
;
}
});
this
.
ucDataGridView1
.
Columns
=
lstCulumns
;
this
.
ucDataGridView1
.
Columns
=
lstCulumns
;
this
.
ucDataGridView1
.
IsShowCheckBox
=
true
;
this
.
ucDataGridView1
.
IsShowCheckBox
=
true
;
List
<
object
>
lstSource
=
new
List
<
object
>();
List
<
object
>
lstSource
=
new
List
<
object
>();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论