SkillAgentSearch skills...

NetWinformControl

HZHControls,c#winfrom custom control, has better operation support for touch screen, the project is based on framework4.0, completely native control development, do not use any third-party controls, you can use it safely in your project (winfromcontrol/winformcontrol/.net).There are more abundant industrial controls that continue to increase in the ~~~

Install / Use

/learn @kwwwvagaa/NetWinformControl
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

GitHub is often not connected and cannot submit updates. Please check gitee for the latest code,

Gitee address: https://gitee.com/kwwwvagaa/net_winform_custom_control

Website

https://www.hzhcontrol.cn/

NetWinformCustom Controls

My english is poor. The English below is from Google Translate. Please forgive me.

中文README.md(github)

中文README.md(码云)

Introduction

c#winform custom control, has better operation support for touch screen, the project is based on framework4.0, completely native control development, do not use any third-party controls, you can use it safely in your project .

Blog address: https://www.cnblogs.com/bfyx

GitHub: https://github.com/kwwwvagaa/NetWinformControl

Code Cloud: https://gitee.com/kwwwvagaa/net_winform_custom_control.git

Welcome to exchange discussion: Click to join QQ group 568015492

If my code is useful to you, please reward me, thank you, your reward is my motivation.

输入图片说明 输入图片说明

The source code is only for exchange learning. The open source agreement is MPL 2.0. For commercial use, please contact the group owner.

Come here, come to a Star and let's go.

NuGet

Install-Package HZH_Controls
The content listed below is only part of the control, more control effects, please download the source code to see the demo running effect!

输入图片说明 输入图片说明

Sample

1, prompt window renderings

sample image sample image

If (FrmDialog.ShowDialog(this, "Do you want to display a prompt box without a cancel button?", "Mode Form Test", true) == System.Windows.Forms.DialogResult.OK)
{
    FrmDialog.ShowDialog(this, "This is a prompt box without a cancel button", "Mode Form Test");
}
2, multiple input form

sample image

 FrmInputs frm = new FrmInputs("Dynamic Multi-Input Form Test",
                New string[] { "name", "telephone", "ID number", "address" },
                New Dictionary<string, HZH_Controls.TextInputType>() { { "Phone", HZH_Controls.TextInputType.Regex }, { "ID number", HZH_Controls.TextInputType.Regex } },
                New Dictionary<string, string>() { { "phone", "^1\\d{10}$" }, { "ID number", "^\\d{18}$" } },
                New Dictionary<string, KeyBoardType>() { { "phone", KeyBoardType.UCKeyBorderNum }, { "ID number", KeyBoardType.UCKeyBorderNum } },
                New List<string>() { "name", "telephone", "identity number" });
frm.ShowDialog(this);
/// <summary>
/// Function Description: Constructor
/// Author: HZH
/// Creation date: 2019-08-05 10:57:26
/// Task number: POS
/// </summary>
/// <param name="strTitle">form title</param>
/// <param name="args">Input name</param>
/// <param name="inTypes">Input type corresponds to input type, key: input item name, if no default control input is not set </param>
/// <param name="regexs">The input item corresponds to the regular rule, valid when imTypes=Regex, key: input item name, if you do not set the default no control input </param>
/// <param name="keyBoards"> text box keyboard, key: input item name, if you do not set the default English keyboard </param>
/// <param name="mastInputs">Required entry name</param>
/// <param name="defaultValues">Input default value, key: input name </param>
Public FrmInputs(
    String strTitle,
    String[] inPutLabels,
    Dictionary<string, TextInputType> inTypes = null,
    Dictionary<string, string> regexs = null,
    Dictionary<string, HZH_Controls.Controls.KeyBoardType> keyBoards = null,
    List<string> mastInputs = null,
    Dictionary<string, string> defaultValues ​​= null)
3, Temp1 form

sample image

/ / New form FrmTemp1Test inherits HZH_Controls.Forms.FrmTemp1
FrmTemp1Test frm = new FrmTemp1Test();
frm.ShowDialog(this);
4, there is a form to confirm cancellation 1

sample image

/ / New form FrmOKCancel1Test inherits HZH_Controls.Forms.FrmWithOKCancel1
FrmOKCancel1Test frm = new FrmOKCancel1Test();
frm.ShowDialog(this);
5, there is a form to confirm cancellation 2

sample image

/ / New form FrmOKCancel2Test inherits HZH_Controls.Forms.FrmWithOKCancel2
FrmOKCancel2Test frm = new FrmOKCancel2Test();
frm.ShowDialog(this);
6, single title form

sample image

/ / New form FrmWithTitleTest inherits HZH_Controls.Forms.FrmWithTitle
FrmWithTitleTest frm = new FrmWithTitleTest();
frm.ShowDialog(this);
7, control

输入图片说明

Text box keyboard effect

sample image sample image sample image

`Handwriting input requires the handwriting support of Sogou, please copy the HandInput folder to the running directory.

Time control effect

sample image sample image sample image

  • Drop-down list data binding *
/ / Use the method is similar to the native 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(), "options" + i));
}

this.ucComboBox1.Source = lstCom;
this.ucComboBox2.Source = lstCom;
this.ucComboBox1.SelectedIndex = 1;
this.ucComboBox2.SelectedIndex = 1;

Tree data binding

/ / Use the same method as the native Treeview, set the property IsShowByCustomModel = true to enable the custom mode, otherwise the original tree
For (int i = 0; i < 5; i++)
{
    TreeNode tn = new TreeNode("parent node" + i);
    For (int j = 0; j < 5; j++)
    {
        tn.Nodes.Add("child node" + j);
    }
    this.treeViewEx1.Nodes.Add(tn);
}

List data binding

/ / Customizable color fonts, etc.
List<ListEntity> lst = new List<ListEntity>();
For (int i = 0; i < 5; i++)
{
    lst.Add(new ListEntity()
    {
        ID = i.ToString(),
        Title = "options" + i,
        ShowMoreBtn = true,
        Source = i
    });
}
this.ucListExt1.SetList(lst);
  • Horizontal list data binding*
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(), "options" + i));
}

this.ucHorizontalList1.DataSource = lstHL;
8, Datagridview

sample image

List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>();
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "ID", HeadText = "Number", Width = 70, WidthType = SizeType.Absolute });
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Name", HeadText = "Name", Width = 50, WidthType = SizeType.Percent });
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Age", HeadText = "Age", Width = 50, WidthType = SizeType.Percent });
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Birthday", HeadText = "Birthday", Width = 50, WidthType = SizeType.Percent, Format = (a) => { return ((DateTime)a).ToString(" yyyy-MM-dd"); } });
lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Sex", HeadText = "Gender", Width = 50, WidthType = SizeType.Percent, Format = (a) => { return ((int)a) == 0 ? "female": "male"; } });
this.ucDataGridView1.Columns = lstCulumns;
this.ucDataGridView1.IsShowCheckBox = true;
List<object> lstSource = new List<object>();
For (int i = 0; i < 20; i++)
{
    TestModel model = new TestModel()
    {
        ID = i.ToString(),
        Age = 3 * i,
        Name = "name -" + i,
        Birthday = DateTime.Now.AddYears(-10),
        Sex = i % 2
    };
    lstSource.Add(model);
}

this.ucDataGridView1.DataSource = lstSource;
this.ucDataGridView1.First();

When using the paging control, you no longer need to specify the DataSource data source property, just specify the DataSource pro

Related Skills

View on GitHub
GitHub Stars2.4k
CategoryDevelopment
Updated3d ago
Forks644

Languages

C#

Security Score

95/100

Audited on Mar 24, 2026

No findings