Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

XML
<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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900