C# wp7开发 要给image定义一个点击时间要怎么写
我想给image写一个单击事件,当我点击了就弹出对话框,是要用到Mouseleftbuttondown和Mouseleftbuttonup这两个事件吗?求详细点的解释,或者代码也行。
[解决办法]
bool MouseLeftButtondown=false;
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
MouseLeftButtondown = true;
}
private void Grid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
MouseLeftButtondown = false;
if (MessageBox.Show(MouseLeftButtondown + "", "信息提示框", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) return;
}