add label for selected layout

This commit is contained in:
Kang Yu 2023-07-30 16:56:28 -07:00
parent 6567b9ad0a
commit 2d56a9b2f2
3 changed files with 23 additions and 4 deletions

View file

@ -31,20 +31,23 @@ namespace PersistentWindows.Common
{
this.ListLayout = new System.Windows.Forms.ListBox();
this.Ok = new System.Windows.Forms.Button();
this.selected = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// ListLayout
//
this.ListLayout.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ListLayout.FormattingEnabled = true;
this.ListLayout.ItemHeight = 16;
this.ListLayout.Location = new System.Drawing.Point(59, 72);
this.ListLayout.ItemHeight = 20;
this.ListLayout.Location = new System.Drawing.Point(59, 40);
this.ListLayout.Name = "ListLayout";
this.ListLayout.Size = new System.Drawing.Size(691, 228);
this.ListLayout.Size = new System.Drawing.Size(685, 244);
this.ListLayout.TabIndex = 0;
this.ListLayout.SelectedIndexChanged += new System.EventHandler(this.ListLayout_SelectedIndexChanged);
//
// Ok
//
this.Ok.Location = new System.Drawing.Point(345, 360);
this.Ok.Location = new System.Drawing.Point(345, 372);
this.Ok.Name = "Ok";
this.Ok.Size = new System.Drawing.Size(105, 36);
this.Ok.TabIndex = 1;
@ -52,11 +55,19 @@ namespace PersistentWindows.Common
this.Ok.UseVisualStyleBackColor = true;
this.Ok.Click += new System.EventHandler(this.Ok_Click);
//
// selected
//
this.selected.Location = new System.Drawing.Point(61, 298);
this.selected.Name = "selected";
this.selected.Size = new System.Drawing.Size(683, 59);
this.selected.TabIndex = 2;
//
// DbKeySelect
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.selected);
this.Controls.Add(this.Ok);
this.Controls.Add(this.ListLayout);
this.Name = "DbKeySelect";
@ -70,5 +81,6 @@ namespace PersistentWindows.Common
private System.Windows.Forms.ListBox ListLayout;
private System.Windows.Forms.Button Ok;
private System.Windows.Forms.Label selected;
}
}

View file

@ -1,4 +1,5 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using PersistentWindows.Common.WinApiBridge;
@ -26,5 +27,10 @@ namespace PersistentWindows.Common
result = ListLayout.SelectedItem.ToString();
Close();
}
private void ListLayout_SelectedIndexChanged(object sender, EventArgs e)
{
selected.Text = ListLayout.SelectedItem.ToString();
}
}
}

View file

@ -505,6 +505,7 @@ namespace PersistentWindows.SystrayShell
{
dlg.InsertCollection(collection);
}
//dlg.InsertCollection(new string('a', 256));
dlg.Icon = IdleIcon;
dlg.ShowDialog(systrayForm);
var result = dlg.result;