マウスがすべてのボタンの側面にあるかどうかを確認する方法を実装しようとします。マウスが左側にあり、次に右側にある場合、ユーザーが
次の画像で特定のアクションを実行し、ユーザーがサイド1のボタンを押してから矢印のように移動する場合サイド2については、ユーザーが特定のアクションを実行するためにアクションを介してこの動きを行うことを確認する方法の問題は、
makeリンクまたはコードのビットを提供して、それを作成するのに役立ちますか?
2 に答える
1
それはそのようなものでなければなりません:
protected Point TouchStart;
private void UIElement_OnMouseEnter(object sender, MouseEventArgs e)
{
TouchStart = e.GetPosition(this);
MyButton.Background = Brushes.Red;
}
private void UIElement_OnMouseLeave(object sender, MouseEventArgs e)
{
var touch = e.GetPosition(this);
if (touch.X >= (TouchStart.X + 99)) //button width here
{
MyButton.Background = Brushes.Aquamarine;
}
}
そしてXAML:
<Button Width="100" x:Name="MyButton" Height="30" MouseEnter="UIElement_OnMouseEnter" MouseLeave="UIElement_OnMouseLeave" >HoverMe</Button>
于 2015-03-25T16:15:42.810 に答える