Revert "button 添加双击事件,解决因快速点击导致效率过慢问题"

This reverts commit e7f62d9b9bdcf742b5fbe403bfee271e87e48fb6.
This commit is contained in:
H 2020-08-23 08:14:33 +08:00
parent e7f62d9b9b
commit 3848fd55c5
3 changed files with 4 additions and 66 deletions

View File

@ -34,17 +34,11 @@
this.uiListBox1 = new Sunny.UI.UIListBox(); this.uiListBox1 = new Sunny.UI.UIListBox();
this.uiCheckBox1 = new Sunny.UI.UICheckBox(); this.uiCheckBox1 = new Sunny.UI.UICheckBox();
this.uiButton1 = new Sunny.UI.UIButton(); this.uiButton1 = new Sunny.UI.UIButton();
this.button1 = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.uiButton2 = new Sunny.UI.UIButton();
this.PagePanel.SuspendLayout(); this.PagePanel.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// PagePanel // PagePanel
// //
this.PagePanel.Controls.Add(this.uiButton2);
this.PagePanel.Controls.Add(this.listBox1);
this.PagePanel.Controls.Add(this.button1);
this.PagePanel.Controls.Add(this.uiButton1); this.PagePanel.Controls.Add(this.uiButton1);
this.PagePanel.Controls.Add(this.uiCheckBox1); this.PagePanel.Controls.Add(this.uiCheckBox1);
this.PagePanel.Controls.Add(this.uiListBox1); this.PagePanel.Controls.Add(this.uiListBox1);
@ -126,36 +120,6 @@
this.uiButton1.Text = "Add Item"; this.uiButton1.Text = "Add Item";
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click); this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
// //
// button1
//
this.button1.Location = new System.Drawing.Point(637, 400);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(112, 35);
this.button1.TabIndex = 24;
this.button1.Text = "Add Item";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 21;
this.listBox1.Location = new System.Drawing.Point(629, 48);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(138, 340);
this.listBox1.TabIndex = 25;
//
// uiButton2
//
this.uiButton2.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton2.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiButton2.Location = new System.Drawing.Point(188, 400);
this.uiButton2.Name = "uiButton2";
this.uiButton2.Size = new System.Drawing.Size(100, 35);
this.uiButton2.TabIndex = 26;
this.uiButton2.Text = "Clear Item";
this.uiButton2.Click += new System.EventHandler(this.uiButton2_Click);
//
// FListBox // FListBox
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F); this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
@ -176,8 +140,5 @@
private UIListBox uiListBox1; private UIListBox uiListBox1;
private UICheckBox uiCheckBox1; private UICheckBox uiCheckBox1;
private UIButton uiButton1; private UIButton uiButton1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button button1;
private UIButton uiButton2;
} }
} }

View File

@ -13,10 +13,10 @@ namespace Sunny.UI.Demo
public override void Init() public override void Init()
{ {
uiListBox1.Items.Clear(); uiListBox1.Items.Clear();
//for (int i = 0; i < 50; i++) for (int i = 0; i < 50; i++)
//{ {
// uiListBox1.Items.Add(i); uiListBox1.Items.Add(i);
//} }
uiImageListBox1.Items.Clear(); uiImageListBox1.Items.Clear();
string[] files = System.IO.Directory.GetFiles(DirEx.CurrentDir() + "Team", string[] files = System.IO.Directory.GetFiles(DirEx.CurrentDir() + "Team",
@ -44,27 +44,10 @@ namespace Sunny.UI.Demo
} }
private int num = 0; private int num = 0;
private int num2 = 0;
private void uiButton1_Click(object sender, System.EventArgs e) private void uiButton1_Click(object sender, System.EventArgs e)
{ {
listBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num2);
num2++;
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num); uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num);
num++; num++;
} }
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num2);
num2++;
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num);
num++;
}
private void uiButton2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
uiListBox1.Items.Clear();
}
} }
} }

View File

@ -76,12 +76,6 @@ namespace Sunny.UI
base.OnClick(e); base.OnClick(e);
} }
protected override void OnDoubleClick(EventArgs e)
{
Focus();
base.OnClick(e);
}
private bool showTips = false; private bool showTips = false;
[Description("是否显示角标"), Category("SunnyUI")] [Description("是否显示角标"), Category("SunnyUI")]