点击事件不适用于手写笔和触控第一次 [英] Click event is not working for stylus and touch for first time

查看:48
本文介绍了点击事件不适用于手写笔和触控第一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





点击事件第一次无法使用手写笔触控。



我有一个用户控件,它有很多子控件。在那里我也有Button控件。按钮控件具有Click事件。



当我使用手写笔/触控点击按钮时,它第一次无效。第二次点击会引发活动。



这是按钮的代码。



< pre lang =xml> < 按钮 名称 = btnOK < span class =code-attribute> 内容 = {x:Static maintab:Resources.Ok} Horizo​​ntalAlignment = 高度 = 58 保证金 = 619,531,-139,0

VerticalAlignment = 顶部 宽度 = 170 背景 = 灰色

< span class =code-attribute>前景 = 白色 点击 = btnOK_Click IsEnabledChanged = buttonSettings_IsEnabledChanged >
< Button.Template >
< ControlTemplate TargetType < span class =code-keyword> = 按钮 >
< Border 名称 = border 已删除 = {TemplateBinding后台} BorderBrush = 灰色 CornerRadius = 5,5,5,5 >
< ContentPresenter Horizo​​ntalAlignment = 中心 VerticalAlignment = 中心 RecognizesAccessKey = True < span class =code-attribute> / >
< / Border >
< / ControlTemplate >
< / Button.Template >
< /按钮 >





请帮我解决这个问题。



谢谢提前,

Harish。

解决方案

Hi,

Click event is not working for the first time with the stylus and touch.

I've an user control, which is having lot of sub controls. In that I've Button controls also there. the button control is having Click event.

When I'm using stylus/Touch to click the button, it is not working for the first time. The event will raise for the second click.

Here is the code for the button.

<Button Name="btnOK" Content="{x:Static maintab:Resources.Ok}" HorizontalAlignment="Left" Height="58" Margin="619,531,-139,0"

                    VerticalAlignment="Top" Width="170" Background="Gray"

                    Foreground="White" Click="btnOK_Click" IsEnabledChanged="buttonSettings_IsEnabledChanged">
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Border Name="border" removed="{TemplateBinding Background}" BorderBrush="Gray" CornerRadius="5,5,5,5">
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
                            </Border>
                        </ControlTemplate>
                    </Button.Template>
                </Button>



Please help me in this to resolve.

Thanks in Advance,
Harish.

解决方案

这篇关于点击事件不适用于手写笔和触控第一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆