Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c4a5ef1e
由
HZH
编写于
2019-08-09 16:59:10 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'master' of
https://gitee.com/kwwwvagaa/net_winform_custom_control
2 个父辈
3622c191
0cb0ed83
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
206 行增加
和
59 行删除
LICENSE
README.en.md
README.md
LICENSE
查看文件 @
c4a5ef1
此文件的差异被折叠,
点击展开。
README.en.md
deleted
100644 → 0
查看文件 @
3622c19
# NetWinform自定义控件
#### Description
c#winfrom自定义控件
#### Software Architecture
Software architecture description
#### Installation
1.
xxxx
2.
xxxx
3.
xxxx
#### Instructions
1.
xxxx
2.
xxxx
3.
xxxx
#### Contribution
1.
Fork the repository
2.
Create Feat_xxx branch
3.
Commit your code
4.
Create Pull Request
#### Gitee Feature
1.
You can use Readme
\_
XXX.md to support different languages, such as Readme
\_
en.md, Readme
\_
zh.md
2.
Gitee blog
[
blog.gitee.com
](
https://blog.gitee.com
)
3.
Explore open source project
[
https://gitee.com/explore
](
https://gitee.com/explore
)
4.
The most valuable open source project
[
GVP
](
https://gitee.com/gvp
)
5.
The manual of Gitee
[
https://gitee.com/help
](
https://gitee.com/help
)
6.
The most popular members
[
https://gitee.com/gitee-stars/
](
https://gitee.com/gitee-stars/
)
\ No newline at end of file
\ No newline at end of file
README.md
查看文件 @
c4a5ef1
# NetWinform自定义控件
# NetWinform自定义控件
#### 介绍
#### 介绍
c#winfrom自定义控件
#### 软件架构
c#winfrom自定义控件,项目是基于framework4.0,完全原生控件开发,没有使用任何第三方控件,你可以放心的用在你的项目中。
软件架构说明
#### 使用
#### 安装教程
1.
添加引用
2.
如果要用到手写需要将HandInput文件夹复制到执行文件目录下(搜狗手写)
1.
xxxx
#### 如果我的代码对您有用,请打赏一点吧,谢谢,您的打赏是我的动力
2.
xxxx
3.
xxxx
#### 使用说明
欢迎前来交流探讨:企鹅号623128629
1.
xxxx
#### 样例
2.
xxxx
3.
xxxx
####
参与贡献
####
# 1、提示窗效果图
1.
Fork 本仓库

2.
新建 Feat_xxx 分支

3.
提交代码
4.
新建 Pull Request
```
csharp
if
(
FrmDialog
.
ShowDialog
(
this
,
"是否再显示一个没有取消按钮的提示框?"
,
"模式窗体测试"
,
true
)
==
System
.
Windows
.
Forms
.
DialogResult
.
OK
)
{
FrmDialog
.
ShowDialog
(
this
,
"这是一个没有取消按钮的提示框"
,
"模式窗体测试"
);
}
```
####
码云特技
####
# 2、多输入窗体
1.
使用 Readme
\_
XXX.md 来支持不同的语言,例如 Readme
\_
en.md, Readme
\_
zh.md
2.
码云官方博客
[
blog.gitee.com
](
https://blog.gitee.com
)
3.
你可以
[
https://gitee.com/explore
](
https://gitee.com/explore
)
这个地址来了解码云上的优秀开源项目
4.
[
GVP
](
https://gitee.com/gvp
)
全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5.
码云官方提供的使用手册
[
https://gitee.com/help
](
https://gitee.com/help
)
6.
码云封面人物是一档用来展示码云会员风采的栏目
[
https://gitee.com/gitee-stars/
](
https://gitee.com/gitee-stars/
)
\ No newline at end of file
\ No newline at end of file

```
csharp
FrmInputs
frm
=
new
FrmInputs
(
"动态多输入窗体测试"
,
new
string
[]
{
"姓名"
,
"电话"
,
"身份证号"
,
"住址"
},
new
Dictionary
<
string
,
HZH_Controls
.
TextInputType
>()
{
{
"电话"
,
HZH_Controls
.
TextInputType
.
Regex
},
{
"身份证号"
,
HZH_Controls
.
TextInputType
.
Regex
}
},
new
Dictionary
<
string
,
string
>()
{
{
"电话"
,
"^1\\d{10}$"
},
{
"身份证号"
,
"^\\d{18}$"
}
},
new
Dictionary
<
string
,
KeyBoardType
>()
{
{
"电话"
,
KeyBoardType
.
UCKeyBorderNum
},
{
"身份证号"
,
KeyBoardType
.
UCKeyBorderNum
}
},
new
List
<
string
>()
{
"姓名"
,
"电话"
,
"身份证号"
});
frm
.
ShowDialog
(
this
);
```
##### 3、Temp1窗体

```
csharp
//新建窗体FrmTemp1Test继承HZH_Controls.Forms.FrmTemp1
FrmTemp1Test
frm
=
new
FrmTemp1Test
();
frm
.
ShowDialog
(
this
);
```
##### 4、有确定取消的窗体1

```
csharp
//新建窗体FrmOKCancel1Test继承HZH_Controls.Forms.FrmWithOKCancel1
FrmOKCancel1Test
frm
=
new
FrmOKCancel1Test
();
frm
.
ShowDialog
(
this
);
```
##### 5、有确定取消的窗体2

```
csharp
//新建窗体FrmOKCancel2Test继承HZH_Controls.Forms.FrmWithOKCancel2
FrmOKCancel2Test
frm
=
new
FrmOKCancel2Test
();
frm
.
ShowDialog
(
this
);
```
##### 6、单标题窗体

```
csharp
//新建窗体FrmWithTitleTest继承HZH_Controls.Forms.FrmWithTitle
FrmWithTitleTest
frm
=
new
FrmWithTitleTest
();
frm
.
ShowDialog
(
this
);
```
##### 7、控件

*文本框键盘效果*



*时间控件效果*



*下拉列表数据绑定*
```
csharp
//使用方法同原生ComboBox类似
List
<
KeyValuePair
<
string
,
string
>>
lstCom
=
new
List
<
KeyValuePair
<
string
,
string
>>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
lstCom
.
Add
(
new
KeyValuePair
<
string
,
string
>(
i
.
ToString
(),
"选项"
+
i
));
}
this
.
ucComboBox1
.
Source
=
lstCom
;
this
.
ucComboBox2
.
Source
=
lstCom
;
this
.
ucComboBox1
.
SelectedIndex
=
1
;
this
.
ucComboBox2
.
SelectedIndex
=
1
;
```
*树数据绑定*
```
csharp
//使用方法同原生Treeview相同,设置属性IsShowByCustomModel=true则启用自定义模式,否则为原始树
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
TreeNode
tn
=
new
TreeNode
(
" 父节点"
+
i
);
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
tn
.
Nodes
.
Add
(
" 子节点"
+
j
);
}
this
.
treeViewEx1
.
Nodes
.
Add
(
tn
);
}
```
*列表数据绑定*
```
csharp
//可自定义颜色字体等
List
<
ListEntity
>
lst
=
new
List
<
ListEntity
>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
lst
.
Add
(
new
ListEntity
()
{
ID
=
i
.
ToString
(),
Title
=
"选项"
+
i
,
ShowMoreBtn
=
true
,
Source
=
i
});
}
this
.
ucListExt1
.
SetList
(
lst
);
```
*横向列表数据绑定*
```
csharp
List
<
KeyValuePair
<
string
,
string
>>
lstHL
=
new
List
<
KeyValuePair
<
string
,
string
>>();
for
(
int
i
=
0
;
i
<
30
;
i
++)
{
lstHL
.
Add
(
new
KeyValuePair
<
string
,
string
>(
i
.
ToString
(),
"选项"
+
i
));
}
this
.
ucHorizontalList1
.
DataSource
=
lstHL
;
```
##### 8、气泡提示效果图(5种内置及自定义样式)

```
csharp
FrmTips
.
ShowTipsError
(
this
,
"Error提示信息"
);
FrmTips
.
ShowTipsInfo
(
this
,
"Info提示信息"
);
FrmTips
.
ShowTipsSuccess
(
this
,
"Success提示信息"
);
FrmTips
.
ShowTipsWarning
(
this
,
"Warning提示信息"
);
/*自定义可使用
public static FrmTips ShowTips(
Form frm,
string strMsg,
int intAutoColseTime = 0,
bool blnShowCoseBtn = true,
ContentAlignment align = ContentAlignment.BottomLeft,
Point? point = null,
TipsSizeMode mode = TipsSizeMode.Small,
Size? size = null,
TipsState state = TipsState.Default)
*/
```
##### 9、多线程操作等待

```
csharp
//此窗体一般用在耗时线程操作时显示等待动图,如下为多线程耗时操作时样例
ControlHelper
.
ThreadRunExt
(
this
,
()
=>
{
Thread
.
Sleep
(
5000
);
ControlHelper
.
ThreadInvokerControl
(
this
,
()
=>
{
FrmTips
.
ShowTipsSuccess
(
this
,
"FrmWaiting测试"
);
});
},
null
,
this
);
//ControlHelper.ThreadRunExt为开启一个线程执行任务
//ControlHelper.ThreadInvokerControl为异步委托 调用控件
```
#### 整体样例效果
##### 1、效果1

##### 2、效果2

##### 3、效果3

#### 最后的话
最后,喜欢请点下stars,如果有其他一些什么常用的控件可以在留言哦
对你有用的话请打赏一下吧,谢谢。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论