C
Join ServerC#
help
Is it possible to run code only when a hover event occurs in my application? [Answered]
LLounder8/16/2022
The application shouldn't get in the way of the user. The user should be able to hover over other applications and mine at the same time. The image illustrates this.

LLounder8/17/2022
Solution:
public void OnHoverHide(object? sender, EventArgs e)
{
Point MousePos = GetMousePosition();
Debug.WriteLine($"\n\n#\n\n{MousePos.X}-{MousePos.Y}\n\n#\n");
Point TopLeftWindowPoint = new Point(AppWindow.Left, AppWindow.Top);
Point BottomRightWindowPoint = new Point(AppWindow.Left + AppWindow.Width, AppWindow.Top + AppWindow.Height);
//If mouse isn't over window
if (MousePos.X >= TopLeftWindowPoint.X && MousePos.Y >= TopLeftWindowPoint.Y)
{
if (MousePos.X <= BottomRightWindowPoint.X && MousePos.Y <= BottomRightWindowPoint.Y)
{
BorderContainer.Opacity = 0;
return;
}
}
BorderContainer.Opacity = 1;
}
AAccord8/17/2022
✅ This post has been marked as answered!