SoFunction
Updated on 2025-03-07

Implementation method of using WPF to implement screen text prompts


Code
/// <summary>
/// Mouse moving in processing
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Window_MouseEnter(object sender, MouseEventArgs e)
{
Brush brush = new SolidColorBrush((0x78,0xFF,0xFF,0xFF));  // Create a solid color brush
= brush;  // Apply to grid
}
/// <summary>
/// Mouse removal method
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Window_MouseLeave(object sender, MouseEventArgs e)
{
Brush brush = new SolidColorBrush((0x52, 0xFF, 0xFF, 0xFF, 0xFF)); // Create a solid color brush
= brush;  // Apply to grid
}
/// <summary>
/// Mouse pressing method
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
();  // Or use () to hide the window
}