📄 selectfieldsform.cs
字号:
using System;
namespace CommonComponent.CommonIE
{
/// <summary>
///
/// </summary>
public class SelectFieldsForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnSelectALL;
private System.Windows.Forms.Button btnSelectNone;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.ListView lvFieldList;
private System.Windows.Forms.Button btnCancel;
private void InitializeComponent()
{
this.lvFieldList = new System.Windows.Forms.ListView();
this.btnSelectALL = new System.Windows.Forms.Button();
this.btnSelectNone = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lvFieldList
//
this.lvFieldList.CheckBoxes = true;
this.lvFieldList.Location = new System.Drawing.Point(10, 10);
this.lvFieldList.Name = "lvFieldList";
this.lvFieldList.Size = new System.Drawing.Size(429, 239);
this.lvFieldList.TabIndex = 0;
this.lvFieldList.View = System.Windows.Forms.View.List;
//
// btnSelectALL
//
this.btnSelectALL.Location = new System.Drawing.Point(34, 271);
this.btnSelectALL.Name = "btnSelectALL";
this.btnSelectALL.TabIndex = 1;
this.btnSelectALL.Text = "全选(&A)";
this.btnSelectALL.Click += new System.EventHandler(this.btnSelectALL_Click);
//
// btnSelectNone
//
this.btnSelectNone.Location = new System.Drawing.Point(136, 271);
this.btnSelectNone.Name = "btnSelectNone";
this.btnSelectNone.TabIndex = 2;
this.btnSelectNone.Text = "全不选";
this.btnSelectNone.Click += new System.EventHandler(this.btnSelectNone_Click);
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(238, 271);
this.btnOK.Name = "btnOK";
this.btnOK.TabIndex = 3;
this.btnOK.Text = "确定(&O)";
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(340, 271);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 4;
this.btnCancel.Text = "取消(&C)";
//
// SelectFieldsForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(449, 313);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.btnSelectNone);
this.Controls.Add(this.btnSelectALL);
this.Controls.Add(this.lvFieldList);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "SelectFieldsForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "请选择需要导出的字段";
this.ResumeLayout(false);
}
public SelectFieldsForm()
{
InitializeComponent();
//
// TODO: Add constructor logic here
//
}
private void btnSelectALL_Click(object sender, System.EventArgs e)
{
SelectAll();
}
private void btnSelectNone_Click(object sender, System.EventArgs e)
{
SelectNone();
}
public System.Windows.Forms.ListView FieldList
{
get
{
return lvFieldList;
}
}
public void SelectAll()
{
foreach(System.Windows.Forms.ListViewItem item1 in lvFieldList.Items)
item1.Checked = true;
}
public void SelectNone()
{
foreach(System.Windows.Forms.ListViewItem item1 in lvFieldList.Items)
item1.Checked = false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -