Reputation: 173
I need to find a way to check if the mouse moves in c#, while the left button is down.
Upvotes: 14
Views: 9467
Reputation: 56536
Here's an example (WPF):
public MainWindow()
{
InitializeComponent();
this.MouseMove += new MouseEventHandler(MainWindow_MouseMove);
}
void MainWindow_MouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
//do something
}
}
Upvotes: 23