This issue recommends the HZHControls control library, c# winform custom controls, with better operation support for touch screen, the project is based on Framework4.0, completely native control development, without the use of any third-party controls, you can rest assured to use in your project。
NetWinform Describes custom controls
The HZHControls control library supports a variety of styles, Including multiple input forms, there is a confirm cancel form, single title form, controls, page controls, bubble prompt renderings, menu navigation, button groups, progress bars, switches, water waves, trees, sliders, LED numbers, scrolling text, pipes, signal lights, thermometers, resource loading forms, pyramid charts, timelines, reference blocks, and so on.
Give an example
1, prompt window renderings
if (FrmDialog.ShowDialog(this, "Do you want to display another prompt box without a cancel button?" , "Pattern Forms test", true) == System.Windows.Forms.DialogResult.OK){ FrmDialog.ShowDialog(this, "这是一个没有取消按钮的提示框", "模式窗体测试");}
2、Multiple input form
FrmInputs frm = new FrmInputs("Dynamic multi-input form testing", new string[] { "Name ", "Telephone "," ID number ", "address" }, 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 Form
// Create a new form FrmTemp1Test inheritanceHZH_Controls.Forms.FrmTemp1FrmTemp1Test frm = new FrmTemp1Test();frm.ShowDialog(this);
4、There is a form with definite cancellation
//Create a new form FrmOKCancel1Test inheritanceHZH_Controls.Forms.FrmWithOKCancel1FrmOKCancel1Test frm = new FrmOKCancel1Test();frm.ShowDialog(this);
5、Datagridview
List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>();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 = "Age", HeadText = "年龄", Width = 50, WidthType = SizeType.Percent });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 = "Sex", HeadText = "性别", Width = 50, WidthType = SizeType.Percent, Format = (a) => { return ((int)a) == 0 ? "女" : "男"; } });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 = "姓名——" + i, Birthday = DateTime.Now.AddYears(-10), Sex = i % 2 }; lstSource.Add(model);}this.ucDataGridView1.DataSource = lstSource;this.ucDataGridView1.First();
When using paging controls, you no longer need to specify the DataSource data source property, you only need to specify the DataSource property of the paging control
If the preset table row does not meet your needs, you can also customize the row control, the specific practice is:
Added a custom control to implement the interface IDataGridViewRow
Refer to UCDataGridViewRow to implement your custom rows
Set the RowType attribute of the datagridview
The Page property defines the page turning control, if UCPagerControl does not meet your needs, please customize the page turning control and inherit UCPagerControlBase, when it is empty, do not enable the page turning control, when the page turning control is enabled, each page will display the appropriate data, no longer appear scroll bar.
6, bubble prompt renderings (5 built-in and custom styles)
FrmTips.ShowTipsError(this, "ErrorPrompt message ");FrmTips.ShowTipsInfo(this, "InfoPrompt message ");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)*/