* UITextBox:解决多行输入时不能输入回车的问题

This commit is contained in:
Sunny 2021-04-17 11:20:32 +08:00
parent 74271f14ea
commit 1ecb1cf02f
4 changed files with 34 additions and 27 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -61,6 +61,8 @@ namespace Sunny.UI
}
protected override void OnKeyDown(KeyEventArgs e)
{
if (!Multiline)
{
if (e.KeyData == Keys.Enter || e.KeyData == Keys.Down)
{
@ -77,6 +79,7 @@ namespace Sunny.UI
e.Handled = true;
}
if (e.KeyData == Keys.Up)
{
if (EnterAsTab)
@ -86,6 +89,7 @@ namespace Sunny.UI
e.Handled = true;
}
}
if (e.Control && e.KeyCode == Keys.A)
{
@ -450,6 +454,8 @@ namespace Sunny.UI
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (!Multiline)
{
//以下代码 取消按下回车或esc的“叮”声
if (e.KeyChar == Convert.ToChar(13) || e.KeyChar == Convert.ToChar(27))
@ -463,6 +469,7 @@ namespace Sunny.UI
{
e.Handled = true;
}
}
base.OnKeyPress(e);
}