How would I record last mouse click ?
I have a program where I have images called red_balloon and green_balloon.
I give the user points depending if they click the balloons in the right order, red_balloon then green_balloon.
If the order is not correct they loose a point.
So I need a way to record last click, is there a simple way of doing this.
Here is my code so far..
**Code XAML**
<Image Height="53" HorizontalAlignment="Left" Margin="0,0,0,0" x:Name="red_balloon" Stretch="Fill" VerticalAlignment="Top" Width="48" Source="red.png" MouseLeftButtonDown="redballoon_click" Canvas.Left="194" Canvas.Top="161" RenderTransformOrigin="0.938,0.536" />
<Image Height="53" HorizontalAlignment="Left" Margin="0,0,0,0" x:Name="green_balloon" Stretch="Fill" VerticalAlignment="Top" Width="48" Source="green.png" MouseLeftButtonDown="redballoon_click" Canvas.Left="194" Canvas.Top="161" RenderTransformOrigin="0.938,0.536" />
**Code c#**
private void greenballoon_click(object sender, MouseButtonEventArgs e)
{
if (last_click =="red_balloon")
{
PopBalloonCount++;
}
else
{
PopBalloonCount--;
}
score.Content = "Your Score" + " " + Convert.ToString(PopBalloonCount);
}