Refactored the listbox into a listview

This commit is contained in:
Thorsten Sommer 2022-07-17 16:01:11 +02:00
parent ccc858830b
commit fa36300399
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 19 additions and 22 deletions

View File

@ -34,10 +34,10 @@
this.buttonAdd = new System.Windows.Forms.Button(); this.buttonAdd = new System.Windows.Forms.Button();
this.buttonRemove = new System.Windows.Forms.Button(); this.buttonRemove = new System.Windows.Forms.Button();
this.buttonRename = new System.Windows.Forms.Button(); this.buttonRename = new System.Windows.Forms.Button();
this.listTextElements = new System.Windows.Forms.ListBox();
this.textBoxFilter = new System.Windows.Forms.TextBox(); this.textBoxFilter = new System.Windows.Forms.TextBox();
this.labelFilter = new System.Windows.Forms.Label(); this.labelFilter = new System.Windows.Forms.Label();
this.labelSectionPath = new System.Windows.Forms.Label(); this.labelSectionPath = new System.Windows.Forms.Label();
this.listTextElements = new System.Windows.Forms.ListView();
this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.tableLayout.SuspendLayout(); this.tableLayout.SuspendLayout();
this.flowLayoutToolbar.SuspendLayout(); this.flowLayoutToolbar.SuspendLayout();
@ -50,10 +50,10 @@
this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F)); this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayout.Controls.Add(this.flowLayoutToolbar, 0, 0); this.tableLayout.Controls.Add(this.flowLayoutToolbar, 0, 0);
this.tableLayout.Controls.Add(this.listTextElements, 1, 1);
this.tableLayout.Controls.Add(this.textBoxFilter, 2, 2); this.tableLayout.Controls.Add(this.textBoxFilter, 2, 2);
this.tableLayout.Controls.Add(this.labelFilter, 1, 2); this.tableLayout.Controls.Add(this.labelFilter, 1, 2);
this.tableLayout.Controls.Add(this.labelSectionPath, 1, 0); this.tableLayout.Controls.Add(this.labelSectionPath, 1, 0);
this.tableLayout.Controls.Add(this.listTextElements, 1, 1);
this.tableLayout.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayout.Location = new System.Drawing.Point(0, 0); this.tableLayout.Location = new System.Drawing.Point(0, 0);
this.tableLayout.Name = "tableLayout"; this.tableLayout.Name = "tableLayout";
@ -120,19 +120,6 @@
this.buttonRename.UseVisualStyleBackColor = true; this.buttonRename.UseVisualStyleBackColor = true;
this.buttonRename.Click += new System.EventHandler(this.buttonRename_Click); this.buttonRename.Click += new System.EventHandler(this.buttonRename_Click);
// //
// listTextElements
//
this.tableLayout.SetColumnSpan(this.listTextElements, 2);
this.listTextElements.Dock = System.Windows.Forms.DockStyle.Fill;
this.listTextElements.FormattingEnabled = true;
this.listTextElements.IntegralHeight = false;
this.listTextElements.ItemHeight = 28;
this.listTextElements.Location = new System.Drawing.Point(69, 43);
this.listTextElements.Name = "listTextElements";
this.listTextElements.ScrollAlwaysVisible = true;
this.listTextElements.Size = new System.Drawing.Size(634, 115);
this.listTextElements.TabIndex = 1;
//
// textBoxFilter // textBoxFilter
// //
this.textBoxFilter.Dock = System.Windows.Forms.DockStyle.Fill; this.textBoxFilter.Dock = System.Windows.Forms.DockStyle.Fill;
@ -166,6 +153,22 @@
this.labelSectionPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.labelSectionPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.toolTip.SetToolTip(this.labelSectionPath, "The path of the currently selected section"); this.toolTip.SetToolTip(this.labelSectionPath, "The path of the currently selected section");
// //
// listTextElements
//
this.tableLayout.SetColumnSpan(this.listTextElements, 2);
this.listTextElements.Dock = System.Windows.Forms.DockStyle.Fill;
this.listTextElements.FullRowSelect = true;
this.listTextElements.GridLines = true;
this.listTextElements.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.listTextElements.Location = new System.Drawing.Point(69, 43);
this.listTextElements.MultiSelect = false;
this.listTextElements.Name = "listTextElements";
this.listTextElements.ShowGroups = false;
this.listTextElements.Size = new System.Drawing.Size(634, 115);
this.listTextElements.TabIndex = 5;
this.listTextElements.UseCompatibleStateImageBehavior = false;
this.listTextElements.View = System.Windows.Forms.View.List;
//
// toolTip // toolTip
// //
this.toolTip.AutoPopDelay = 30000; this.toolTip.AutoPopDelay = 30000;
@ -197,9 +200,9 @@
private Button buttonRename; private Button buttonRename;
private Button buttonRemove; private Button buttonRemove;
private ToolTip toolTip; private ToolTip toolTip;
private ListBox listTextElements;
private TextBox textBoxFilter; private TextBox textBoxFilter;
private Label labelFilter; private Label labelFilter;
private Label labelSectionPath; private Label labelSectionPath;
private ListView listTextElements;
} }
} }

View File

@ -60,10 +60,4 @@
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>