36 lines
759 B
C#
36 lines
759 B
C#
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace mpvnet
|
|
{
|
|
public class CursorHelp
|
|
{
|
|
static bool IsVisible = true;
|
|
|
|
public static void Show()
|
|
{
|
|
if (!IsVisible)
|
|
{
|
|
Cursor.Show();
|
|
IsVisible = true;
|
|
}
|
|
}
|
|
|
|
public static void Hide()
|
|
{
|
|
if (IsVisible)
|
|
{
|
|
Cursor.Hide();
|
|
IsVisible = false;
|
|
}
|
|
}
|
|
|
|
public static bool IsPosDifferent(Point screenPos)
|
|
{
|
|
return
|
|
Math.Abs(screenPos.X - Control.MousePosition.X) > 10 ||
|
|
Math.Abs(screenPos.Y - Control.MousePosition.Y) > 10;
|
|
}
|
|
}
|
|
} |