* UIControl: WIN10系统响应触摸屏增加了TouchPressClick属性,默认关闭

This commit is contained in:
Sunny 2023-02-08 11:24:31 +08:00
parent 20ed2e0be4
commit 05011d57f8
2 changed files with 27 additions and 16 deletions

Binary file not shown.

View File

@ -994,6 +994,10 @@ namespace Sunny.UI
this.Invalidate();
}
[Description("开启后可响应某些触屏的点击事件"), Category("SunnyUI")]
[DefaultValue(false)]
public bool TouchPressClick { get; set; } = false;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////// WndProc窗口程序
////// 当按压屏幕时产生一个WM_POINTERDOWN消息时我们通过API函数 PostMessage 投送出一个WM_LBUTTONDOWN消息
@ -1011,6 +1015,8 @@ namespace Sunny.UI
const int WM_LBUTTONUP = 0x0202;
protected override void WndProc(ref Message m)
{
if (TouchPressClick)
{
switch (m.Msg)
{
@ -1033,6 +1039,11 @@ namespace Sunny.UI
break;
}
}
else
{
base.WndProc(ref m);
}
}
#endregion