none
Mover Controles Label RRS feed

  • Pregunta

  • Hola.

    #Region "MOVER LABELS"
        Private dgpr As Boolean = False
        Private msdx As Integer = 0
        Private msdy As Integer = 0
        Sub MoverLetras(ByVal sender As System.Object, ByVal e As System.EventArgs)
            For Each ctrl As Label In PnLtr1.Controls
                AddHandler ctrl.MouseDown, AddressOf Letras_MouseDown
                AddHandler ctrl.MouseUp, AddressOf Letras_MouseUp
                AddHandler ctrl.MouseMove, AddressOf Letras_MouseMove
            Next ctrl
        End Sub
        Private Sub Letras_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
            If Not Me.dgpr Then
                dgpr = True
                msdx = e.X
                msdy = e.Y
            End If
            Return
                End Sub
        Private Sub Letras_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
            If e.Button = MouseButtons.Left Then
                dgpr = False
            End If
            Return
            GC.Collect()
        End Sub
        Private Sub Letras_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
            If dgpr Then
                Dim pont As New Point()
                Dim pbx As Label = CType(sender, Label)
                pont.X = pbx.Location.X + (e.X - msdx)
                pont.Y = pbx.Location.Y + (e.Y - msdy)
                pbx.Location = pont
            End If
            Return
        End Sub
    #End Region

    Se pueden mover Controles Label en una aplicación Compact Framework para Pocket Pc?

    Gracias.


    Rafael FM

    viernes, 2 de diciembre de 2016 12:53