button 添加'是否启用双击事件'属性,解决连续点击效率问题
This commit is contained in:
parent
3848fd55c5
commit
352e68fabd
1
SunnyUI.Demo/Controls/FListBox.Designer.cs
generated
1
SunnyUI.Demo/Controls/FListBox.Designer.cs
generated
@ -119,6 +119,7 @@
|
|||||||
this.uiButton1.TabIndex = 23;
|
this.uiButton1.TabIndex = 23;
|
||||||
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);
|
||||||
|
this.uiButton1.DoubleClick += new System.EventHandler(this.uiButton1_DoubleClick);
|
||||||
//
|
//
|
||||||
// FListBox
|
// FListBox
|
||||||
//
|
//
|
||||||
|
@ -49,5 +49,11 @@ namespace Sunny.UI.Demo
|
|||||||
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num);
|
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num);
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void uiButton1_DoubleClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_double_" + num);
|
||||||
|
num++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -55,6 +55,7 @@ namespace Sunny.UI
|
|||||||
fillHoverColor = UIStyles.Blue.ButtonFillHoverColor;
|
fillHoverColor = UIStyles.Blue.ButtonFillHoverColor;
|
||||||
fillPressColor = UIStyles.Blue.ButtonFillPressColor;
|
fillPressColor = UIStyles.Blue.ButtonFillPressColor;
|
||||||
fillSelectedColor = UIStyles.Blue.ButtonFillSelectedColor;
|
fillSelectedColor = UIStyles.Blue.ButtonFillSelectedColor;
|
||||||
|
SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isClick;
|
private bool isClick;
|
||||||
@ -76,6 +77,27 @@ namespace Sunny.UI
|
|||||||
base.OnClick(e);
|
base.OnClick(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool useDoubleClick = false;
|
||||||
|
|
||||||
|
[Description("是否启用双击事件"), Category("SunnyUI")]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool UseDoubleClick
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return useDoubleClick;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (useDoubleClick != value)
|
||||||
|
{
|
||||||
|
useDoubleClick = value;
|
||||||
|
SetStyle(ControlStyles.StandardDoubleClick, value);
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool showTips = false;
|
private bool showTips = false;
|
||||||
|
|
||||||
[Description("是否显示角标"), Category("SunnyUI")]
|
[Description("是否显示角标"), Category("SunnyUI")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user