martes, 30 de octubre de 2012

Mover Panel (Drag and Drop)



Public Class Form1
   Private FlgMover_01 As Boolean = False
   Private Ubicacion_01 As New Point

   Private FlgMover_02 As Boolean = False
   Private Ubicacion_02 As New Point

   Private Sub panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
      FlgMover_01 = True
      Ubicacion_01 = New Point(e.X, e.Y)
      Me.Cursor = Cursors.SizeAll
   End Sub

   Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
      If FlgMover_01 = True Then
         Panel1.Location = New Point(Panel1.Location.X + e.X - Ubicacion_01.X, Panel1.Location.Y + e.Y - Ubicacion_01.Y)
      End If
   End Sub

   Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
      FlgMover_01 = False
      Me.Cursor = Cursors.Default
   End Sub

   Private Sub Panel2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseDown
      FlgMover_02 = True
      Ubicacion_02 = New Point(e.X, e.Y)
      Me.Cursor = Cursors.SizeAll
   End Sub

   Private Sub Panel2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseMove
      If FlgMover_02 = True Then
         Panel2.Location = New Point(Panel2.Location.X + e.X - Ubicacion_02.X, Panel2.Location.Y + e.Y - Ubicacion_02.Y)
      End If
   End Sub

   Private Sub Panel2_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseUp
      FlgMover_02 = False
      Me.Cursor = Cursors.Default
   End Sub

End Class

15 comentarios:

Anónimo dijo...

buy tramadol online without a prescription tramadol addiction during pregnancy - buy tramadol online in usa

Anónimo dijo...

buy tramadol no prescription generic tramadol medication - tramadol withdrawal+muscle aches

Anónimo dijo...

generic cialis buy cialis online fast shipping generic - generic cialis tadalafil

Anónimo dijo...

xanax without a perscription buy xanax online - generic for xanax

Anónimo dijo...

xanax online percocet xanax drug interactions - xanax (generic) 2 mg pills

Anónimo dijo...

buy cialis online cialis price compare - user reviews cialis daily use

Anónimo dijo...

tramadol 50 mg buy generic tramadol - can tramadol withdrawal kill you

Anónimo dijo...

http://landvoicelearning.com/#63987 cheap tramadol no prescription overnight - high on tramadol 50mg

Anónimo dijo...

buy tramadol online reviews tramadol 50 mg tablets dosage - tramadol 100mg for dogs

Anónimo dijo...

buy tramadol tramadol 50mg tablets dosage - buy tramadol online overnight shipping

Anónimo dijo...

http://staam.org/#56274 high on tramadol 50mg - buy tramadol cod overnight delivery

Anónimo dijo...

buy tramadol online illegal buy tramadol online - tramadol high review

Anónimo dijo...

xanax cheap is generic xanax the same - xanax dosage strengths

Anónimo dijo...

http://ranchodelastortugas.com/#37284 how much are xanax 1 mg worth - xanax effects synapse

Anónimo dijo...

I do not even know how I ended up here, but I thought this post was good.
I do not know who you are but definitely you're going to a famous blogger if you aren't already ;) Cheers!


Also visit my website http://wiki.ku.dk