Winform常用自定义控件库
$ dotnet add package DHZX.UserControlsDescription
提供一个可以调整样式的按钮。
Properties
| Name | Type | Description |
|---|---|---|
| ButtonText | System.String | 按钮文本 |
点击事件示例
private void blueButton1_Load(object sender, EventArgs e)
{
this.blueButton1.MyClick += BlueButton1_MyClick;
}
private void BlueButton1_MyClick(object arg1, EventArgs arg2)
{
this.DialogResult = DialogResult.OK;
}
Description
提供一个带自定义边框样式、标题的ListBox。
Properties
| Name | Type | Description |
|---|---|---|
| AddItem | System.String | 向ListBox中添加项 |
| MaxItems | System.Int32 | ListBox最大项数 |
| MyCornerRadius | System.Single[] | 圆角半径 |
| FColor | System.Drawing.Color | 边框开始颜色 |
| TColor | System.Drawing.Color | 边框结束颜色 |
| MyBorderThickness | System.Int32 | 边框粗细 |
| MyLinearGradientMode | System.Drawing.Drawing2D.LinearGradientMode | 指定线性渐变的方向 |
| MyForeColor | System.Drawing.Color | 字体颜色 |
| Title | System.String | 标题 |
Description
提供一个封装好的分页控件。
Properties
| Name | Type | Description |
|---|---|---|
| PageIndex | System.Int32 | 当前页面 |
| PageSize | System.Int32 | 每页记录数 |
| RecordCount | System.Int32 | 总记录数 |
| PageCount | System.Int32 | 总页数 |
| JumpText | System.String | 跳转按钮文本 |
Description
提供可自定义样式的圆环图表,可展示进度等信息。
Properties
| Name | Type | Description |
|---|---|---|
| SweepAngle | System.Single | 从 startAngle 参数沿顺时针方向旋转到扇形区第二个边所测得的角度(以度为单位) |
| TotalCount | System. Single | 总数量 |
| Count | System.Single | 数量 |
| RingFromColor | System.Drawing.Color | 环形渐变的开始颜色 |
| RingToColor | System.Drawing.Color | 环形渐变的结束颜色 |
| RingBackColor | System.Drawing.Color | 环形背景色 |
| CircleFillColor | System.Drawing.Color | 环形小圆填充色 |
| LineColor | System.Drawing.Color | 描边线条颜色 |
| PercentFont | System.Drawing.Font | 百分比字体 |
| PercentFontColor | System.Drawing.Color | 百分比字体颜色 |
Description
提供一个带自定义边框样式、标题的RichTextBox。
Properties
| Name | Type | Description |
|---|---|---|
| AppendText | System.String | 向richTextBox文本中追加文本 |
| MaxTextLength | System.String | richTextBox文本最大长度 |
| MyCornerRadius | System.Single[] | 圆角半径 |
| FColor | System.Drawing.Color | 边框开始颜色 |
| TColor | System.Drawing.Color | 边框结束颜色 |
| RichTextBoxBackColor | System.Drawing.Color | RichTextBox背景色 |
| MyBorderThickness | System.Int32 | 边框粗细 |
| MyLinearGradientMode | System.Drawing.Drawing2D.LinearGradientMode | 指定线性渐变的方向 |
| MyForeColor | System.Drawing.Color | 字体颜色 |
| Title | System.String | 标题 |
Description
提供一个圆角矩形、样式可调整的边框容器。
Properties
| Name | Type | Description |
|---|---|---|
| MyCornerRadius | System.Single[] | 圆角半径 |
| FColor | System.Drawing.Color | 边框开始颜色 |
| TColor | System.Drawing.Color | 边框结束颜色 |
| MyBorderThickness | System.Int32 | 边框粗细 |
| MyLinearGradientMode | System.Drawing.Drawing2D.LinearGradientMode | 指定线性渐变的方向 |
Description
提供一个可用于页面边框、样式可调整的容器。
Properties
| Name | Type | Description |
|---|---|---|
| BorderColor | System.Drawing.Color | 边框颜色 |
| ContentBackColor | System.Drawing.Color | 内容部分背景色 |
| IsMainForm | System.Boolean | 是否为主窗体 |
| MaxLableVisibile | System.Boolean | 最大化是否显示 |
| MinLableVisibile | System.Boolean | 最小化是否显示 |
| MyImage | System.Drawing.Image | 页面图标 |
| MyTitle | System.String | 页面标题 |
| TitleBackColor | System.Drawing.Color | 标题栏背景色 |
| MoveEnable | System.Boolean | 是否可以拖动 |
为使用FormPanel控件的页面设置图标
只需在引用该类库项目的输出目录中放入图标文件“logo.ico”即可。
Description
显示一个圆形、具有绿色、黄色、红色、灰色状态指示的控件。
Properties
| Name | Type | Description |
|---|---|---|
| ID | System.Int64 | 标识 |
| MyState | System.String | 状态 |
| MyText | System.String | 显示文本 |
Description
显示一个具有三色指示灯(绿色、黄色、红色)的状态指示控件。
Properties
| Name | Type | Description |
|---|---|---|
| ID | System.Int64 | 标识 |
| MyState | System.String | 状态 |
| MyStyle | ZDZN.State.TricolorLamp.ShowStyle | 控件样式 垂直或水平 |