Public Declare Function SetCapture Lib "user32.dll" (ByVal hWnd As Long) As Long Public Declare Function ReleaseCapture Lib "user32.dll" () As Long Private Sub Form1_Load() Dim retval As Long ' return value retval = SetCapture(Picture1.hWnd) Picture1.ScaleMode = 3 End Sub Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Static oldX As Long, oldY As Long ' the previous mouse coordinates Picture1.Line (Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2)-(oldX, oldY), _ Picture1.BackColor Picture1.Line (Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2)-(X, Y) oldX = X: oldY = Y End Sub Private Sub Picture1_Click() Dim retval As Long retval = ReleaseCapture() End Sub
ScaleMode
Picture1.Line
Picture1.ScaleWidth / 2
<small>-- line 1 col 8: invalid NonModuleDeclaration</small>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)