15 Ocak 2012 Pazar

Visual Basic Kontrolleri Taşımak

Posted by Unknown On 00:11 No comments

Burada bir picturebox form üzerinde drag&drop ile tasinmaktadir.

Option Explicit
Public globalX As Integer
Public globalY As Integer

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Picture1.Move X - globalX, Y - globalY
End Sub

Private Sub Picture1_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Picture1.Drag vbBeginDrag
globalX = X
globalY = Y
End Sub

0 yorum:

Yorum Gönder