PDA

View Full Version : سوال: در مورد form web app در Visual Studio 2008



bamshad
یک شنبه 16 تیر 1387, 00:31 صبح
من چجوری میتونم در visual studio 2008 اشیا را که داخل فرم وارد میکنم با درک کردن جابجا کنم؟

Zaparo
یک شنبه 16 تیر 1387, 19:29 عصر
Dim dragFlag As Boolean = False
Dim xPosition, yPosition As Integer

Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
Dim che As New ChessLabel(10, 30)
MessageBox.Show(che.X.ToString() + che.Y.ToString())

Me.xPosition = e.X
Me.yPosition = e.Y
Me.dragFlag = True
End Sub

Private Sub PictureBox1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If (Me.dragFlag) Then
Me.PictureBox1.Left = Me.PictureBox1.Left + e.X - Me.xPosition
Me.PictureBox1.Top = Me.PictureBox1.Top + e.Y - Me.yPosition
End If
End Sub

Private Sub PictureBox1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
Me.dragFlag = False
End Sub