I can't find a mouse routine to plagurize into my programming efforts. It appears that using the mouse is as difficult as printing the screen.
Any links to "mouse made easy in VB2005"
Ox
I can't find a mouse routine to plagurize into my programming efforts. It appears that using the mouse is as difficult as printing the screen.
Any links to "mouse made easy in VB2005"
Ox
mouse input in VB2005 programs
Pepo
Well... you will probably use a Control to display your graph. The Control class has some events related to mouse handling:
MouseDown, MouseMove, MouseUp.
Each of these event has an argument of type MouseEventArgs which holds information about the pressed button and the mouse coordinates (in pixels) relative to the upper left corner of the control that generated the mouse event.
So, assuming you have a Panel called Panel1 a sub that handles MouseDown event looks like this:
Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
{
If e.Button = MouseButtons.Left Then
MessageBox.Show("X = " + e.X.ToString() + " Y = " + e.Y.ToString()");
end if
}
See, for example, the documentation for MouseDown event:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.mousedown.aspx
arby99
What that "mouse routine" should do
nkh8204
After displaying a graph for instance, I would like to detect a click and the text clicked on (if any ) as well as the x and y coordinates at button.up. ( like a low voltage on the Y axis and time on X)
If X & Y come back in other ways than pixels (from the upper left hand corner of the screen) I would like to hear how to accomplish that.
From what I've seen in the help files this needs to be a sub or function that serves your particular programming style and you just use the items needed each time it is invoked.
Copying it from one program to the next.
Ox