Option Explicit Private Declare Function ReleaseCapture Lib "user32" () As Long ' et de la relacher 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 Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Sub Command1_Click() Load Picture2(Picture2.UBound + 1) Picture2(Picture2.UBound).Print Text1.Text Picture2(Picture2.UBound).Width = Picture2(Picture2.UBound).TextWidth(Text1.Text) Picture2(Picture2.UBound).Visible = True Picture2(Picture2.UBound).ZOrder 0 End Sub Private Sub Form_Load() Picture2(0).Print Text1.Text Picture2(0).Width = Picture2(0).TextWidth(Text1.Text) End Sub Private Sub Picture2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Call ReleaseCapture Call SendMessage(Picture2(Index).hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&) End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question