تقييم الموضوع :
  • 1 أصوات - بمعدل 1
  • 1
  • 2
  • 3
  • 4
  • 5
كود الزر المتحرك
#1
كود :
Friend Class Form1
    Inherits System.Windows.Forms.Form
    Public Function RandomNum(ByRef Min As Object, ByRef Max As Object) As Integer
        RandomNum = Int((Max - Min + 1) * Rnd() + Min)
    End Function
    
    
    
    Private Sub Command1_MouseMove(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.MouseEventArgs) Handles Command1.MouseMove
        Dim Button As Short = eventArgs.Button \ &H100000
        Dim Shift As Short = System.Windows.Forms.Control.ModifierKeys \ &H10000
        Dim X As Single = VB6.PixelsToTwipsX(eventArgs.X)
        Dim Y As Single = VB6.PixelsToTwipsY(eventArgs.Y)
        Dim wh As Object
        Dim ht As Object
        
        ht = RandomNum(VB6.PixelsToTwipsY(Me.Top), VB6.PixelsToTwipsY(Me.Height))
        wh = RandomNum(VB6.PixelsToTwipsX(Me.Left), VB6.PixelsToTwipsX(Me.Width))
        Command1.SetBounds(VB6.TwipsToPixelsX(wh), VB6.TwipsToPixelsY(ht), 0, 0, Windows.Forms.BoundsSpecified.X Or Windows.Forms.BoundsSpecified.Y)
    End Sub

End Class
[/align]
الرد }}}
تم الشكر بواسطة: الاصيله


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم