* UICombobox:更新KeyDown、KeyUp、KeyPress事件。
This commit is contained in:
parent
11a2cdab91
commit
3d7c114294
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
@ -55,6 +55,9 @@ namespace Sunny.UI
|
||||
edit.ForeColor = UIFontColor.Primary;
|
||||
edit.BorderStyle = BorderStyle.None;
|
||||
edit.TextChanged += EditTextChanged;
|
||||
edit.KeyDown += EditOnKeyDown;
|
||||
edit.KeyUp += EditOnKeyUp;
|
||||
edit.KeyPress += EditOnKeyPress;
|
||||
edit.Invalidate();
|
||||
Controls.Add(edit);
|
||||
|
||||
@ -63,6 +66,34 @@ namespace Sunny.UI
|
||||
edit.BackColor = Color.White;
|
||||
}
|
||||
|
||||
public new event KeyEventHandler KeyDown;
|
||||
|
||||
public new event KeyEventHandler KeyUp;
|
||||
|
||||
public new event KeyPressEventHandler KeyPress;
|
||||
|
||||
private void EditOnKeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
KeyPress?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
public event EventHandler DoEnter;
|
||||
|
||||
private void EditOnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
DoEnter?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
KeyDown?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
private void EditOnKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
KeyUp?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
[DefaultValue(null)]
|
||||
public string Watermark
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user