Add show UI checkbox to sample.

This commit is contained in:
Eugene Wang
2023-04-09 18:03:42 -04:00
parent fe89e661fc
commit dcc2c8b862
2 changed files with 63 additions and 48 deletions

View File

@@ -41,17 +41,18 @@
lblState = new System.Windows.Forms.Label(); lblState = new System.Windows.Forms.Label();
label3 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label();
btnOpenDef = new System.Windows.Forms.Button(); btnOpenDef = new System.Windows.Forms.Button();
label4 = new System.Windows.Forms.Label();
btnStart = new System.Windows.Forms.Button();
btnShowSettings = new System.Windows.Forms.Button();
btnClose = new System.Windows.Forms.Button();
capListView = new System.Windows.Forms.ListView(); capListView = new System.Windows.Forms.ListView();
colCap = new System.Windows.Forms.ColumnHeader(); colCap = new System.Windows.Forms.ColumnHeader();
colType = new System.Windows.Forms.ColumnHeader(); colType = new System.Windows.Forms.ColumnHeader();
colCur = new System.Windows.Forms.ColumnHeader(); colCur = new System.Windows.Forms.ColumnHeader();
colDef = new System.Windows.Forms.ColumnHeader(); colDef = new System.Windows.Forms.ColumnHeader();
colSupport = new System.Windows.Forms.ColumnHeader();
colExtended = new System.Windows.Forms.ColumnHeader(); colExtended = new System.Windows.Forms.ColumnHeader();
colSupport = new System.Windows.Forms.ColumnHeader();
label4 = new System.Windows.Forms.Label();
btnStart = new System.Windows.Forms.Button();
btnShowSettings = new System.Windows.Forms.Button();
btnClose = new System.Windows.Forms.Button();
ckShowUI = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit(); ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
splitContainer1.Panel1.SuspendLayout(); splitContainer1.Panel1.SuspendLayout();
splitContainer1.Panel2.SuspendLayout(); splitContainer1.Panel2.SuspendLayout();
@@ -166,6 +167,7 @@
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
splitContainer1.Panel2.Controls.Add(ckShowUI);
splitContainer1.Panel2.Controls.Add(capListView); splitContainer1.Panel2.Controls.Add(capListView);
splitContainer1.Panel2.Controls.Add(label4); splitContainer1.Panel2.Controls.Add(label4);
splitContainer1.Panel2.Controls.Add(btnStart); splitContainer1.Panel2.Controls.Add(btnStart);
@@ -173,7 +175,7 @@
splitContainer1.Panel2.Controls.Add(btnClose); splitContainer1.Panel2.Controls.Add(btnClose);
splitContainer1.Panel2.Controls.Add(label2); splitContainer1.Panel2.Controls.Add(label2);
splitContainer1.Panel2.Controls.Add(lblCurrent); splitContainer1.Panel2.Controls.Add(lblCurrent);
splitContainer1.Size = new System.Drawing.Size(1023, 564); splitContainer1.Size = new System.Drawing.Size(1123, 564);
splitContainer1.SplitterDistance = 325; splitContainer1.SplitterDistance = 325;
splitContainer1.TabIndex = 9; splitContainer1.TabIndex = 9;
// //
@@ -205,6 +207,49 @@
btnOpenDef.UseVisualStyleBackColor = true; btnOpenDef.UseVisualStyleBackColor = true;
btnOpenDef.Click += btnOpenDef_Click; btnOpenDef.Click += btnOpenDef_Click;
// //
// capListView
//
capListView.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
capListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { colCap, colType, colCur, colDef, colExtended, colSupport });
capListView.FullRowSelect = true;
capListView.Location = new System.Drawing.Point(11, 87);
capListView.MultiSelect = false;
capListView.Name = "capListView";
capListView.Size = new System.Drawing.Size(771, 462);
capListView.TabIndex = 8;
capListView.UseCompatibleStateImageBehavior = false;
capListView.View = System.Windows.Forms.View.Details;
//
// colCap
//
colCap.Text = "CAP";
colCap.Width = 230;
//
// colType
//
colType.Text = "Type";
colType.Width = 80;
//
// colCur
//
colCur.Text = "Current";
colCur.Width = 80;
//
// colDef
//
colDef.Text = "Default";
colDef.Width = 80;
//
// colExtended
//
colExtended.Text = "Extended";
colExtended.Width = 80;
//
// colSupport
//
colSupport.Text = "Supports";
colSupport.Width = 330;
//
// label4 // label4
// //
label4.AutoSize = true; label4.AutoSize = true;
@@ -244,48 +289,17 @@
btnClose.UseVisualStyleBackColor = true; btnClose.UseVisualStyleBackColor = true;
btnClose.Click += btnClose_Click; btnClose.Click += btnClose_Click;
// //
// capListView // ckShowUI
// //
capListView.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; ckShowUI.AutoSize = true;
capListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { colCap, colType, colCur, colDef, colExtended, colSupport }); ckShowUI.Checked = true;
capListView.FullRowSelect = true; ckShowUI.CheckState = System.Windows.Forms.CheckState.Checked;
capListView.Location = new System.Drawing.Point(11, 87); ckShowUI.Location = new System.Drawing.Point(437, 35);
capListView.MultiSelect = false; ckShowUI.Name = "ckShowUI";
capListView.Name = "capListView"; ckShowUI.Size = new System.Drawing.Size(69, 19);
capListView.Size = new System.Drawing.Size(671, 462); ckShowUI.TabIndex = 9;
capListView.TabIndex = 8; ckShowUI.Text = "Show UI";
capListView.UseCompatibleStateImageBehavior = false; ckShowUI.UseVisualStyleBackColor = true;
capListView.View = System.Windows.Forms.View.Details;
//
// colCap
//
colCap.Text = "CAP";
colCap.Width = 230;
//
// colType
//
colType.Text = "Type";
colType.Width = 80;
//
// colCur
//
colCur.Text = "Current";
colCur.Width = 80;
//
// colDef
//
colDef.Text = "Default";
colDef.Width = 80;
//
// colSupport
//
colSupport.Text = "Supports";
colSupport.Width = 330;
//
// colExtended
//
colExtended.Text = "Extended";
colExtended.Width = 80;
// //
// Form1 // Form1
// //
@@ -330,5 +344,6 @@
private System.Windows.Forms.ColumnHeader colDef; private System.Windows.Forms.ColumnHeader colDef;
private System.Windows.Forms.ColumnHeader colSupport; private System.Windows.Forms.ColumnHeader colSupport;
private System.Windows.Forms.ColumnHeader colExtended; private System.Windows.Forms.ColumnHeader colExtended;
private System.Windows.Forms.CheckBox ckShowUI;
} }
} }

View File

@@ -361,7 +361,7 @@ namespace WinFormSample
private void btnStart_Click(object sender, EventArgs e) private void btnStart_Click(object sender, EventArgs e)
{ {
twain.EnableSource(false, false); twain.EnableSource(ckShowUI.Checked, false);
} }
} }
} }