VS.net中鼠标读取Picture坐标问题
我在用VS.NET的时候遇到一点问题,我在PictureBox控件Image属性里载入图片,并用MouseUp读取当前鼠标在Picture中的坐标。当Image是我预先载入的图片时我的程序没有问题,但是当我把剪贴板的数据用Timer定时截取到Picture.Image的时候MouseUp就不能用了,请各位帮我看一下我的程序该怎么改动。
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If DispHold = False Then
My.Computer.Clipboard.Clear() : SendMessage(ctCapWin, WM_CAP_Edit_Copy, 0, 0)
End If
If My.Computer.Clipboard.ContainsImage() Then
Me.PictureBox3.Image = My.Computer.Clipboard.GetImage()
End If
End Sub
Private Sub PictureBox3_MouseUp(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.MouseEventArgs)
Dim X As Single
Dim Y As Integer
X = System.Windows.Forms.Cursor.Position.X.ToString - Location.X
Y = System.Windows.Forms.Cursor.Position.Y.ToString - Location.Y
Label2_0.Location = New Point(X, Y)
Text1.text=X & Y
End Sub