You need to capture the MouseDown and MouseUp event, set a boolean, and remember the original coordinates:
bool MouseIsDragging = false;
point Start = new point();
private void MyForm_MouseDown(object sender, MouseEventArgs e)
MouseIsDragging = true;
Start.X = e.X;
Start.Y = e.Y;
private void MyForm_MouseUp(object sender, MouseEventArgs e)
MouseIsDragging = false;
if (e.Y > Start.Y) //can't remember if Y increases or decreases as you go up...
MouseHasBeenDraggedUp(); //Condition is met, do something
//If this needs to be monitored in realtime, and not just when the mouse button is up:
private void MyForm_MouseHover(object sender, MouseEventArgs e)
if (MouseIsDragging == true && e.Y > Start.Y)
MouseHasBeenDraggedUp();// Condition met
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...