Ranma_at
01-21-2004, 03:34 AM
Hello,
Create a new project, place a picturebox on it, copy it and paste it so you have an array of picturebox1().
Then place following code in your form,
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Const HTCAPTION = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Private Sub Picture1_Click(Index As Integer)
MsgBox "Hello World", vbInformation
End Sub
Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
ReleaseCapture
SendMessage Picture1(Index).hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End If
End Sub
Private Sub Picture1_Click(Index As Integer) DOESNT REACT WITH THE LEFT MOUSE BUTTON, only the right one !!!, until you remove the Picture1_MOUSEDOWN event.
thats weird
Am i missing something or is it a bug ??
regards
Ranma_at
Create a new project, place a picturebox on it, copy it and paste it so you have an array of picturebox1().
Then place following code in your form,
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Const HTCAPTION = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Private Sub Picture1_Click(Index As Integer)
MsgBox "Hello World", vbInformation
End Sub
Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
ReleaseCapture
SendMessage Picture1(Index).hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End If
End Sub
Private Sub Picture1_Click(Index As Integer) DOESNT REACT WITH THE LEFT MOUSE BUTTON, only the right one !!!, until you remove the Picture1_MOUSEDOWN event.
thats weird
Am i missing something or is it a bug ??
regards
Ranma_at