复制代码 代码如下:
代码
/// <summary>
/// 鼠标移入处理方法
/// </summary>
/// <param></param>
/// <param></param>
private void Window_MouseEnter(object sender, MouseEventArgs e)
{
Brush brush = new SolidColorBrush(Color.FromArgb(0x78,0xFF,0xFF,0xFF)); // 创建一个纯色brush
grid.Background = brush; // 应用于grid
}
/// <summary>
/// 鼠标移出处理方法
/// </summary>
/// <param></param>
/// <param></param>
private void Window_MouseLeave(object sender, MouseEventArgs e)
{
Brush brush = new SolidColorBrush(Color.FromArgb(0x52, 0xFF, 0xFF, 0xFF)); // 创建一个纯色brush
grid.Background = brush; // 应用于grid
}
/// <summary>
/// 鼠标按下处理方法
/// </summary>
/// <param></param>
/// <param></param>
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
mainWindow.Close(); // 或者使用mainWindow.Hide()隐藏窗口
}
新闻热点
疑难解答
图片精选