VB6.0简单实例!! 高分!!求大神解答!!求代码!!跪求!!

第一题:点击command1,文字label1 向窗体右下角移动,移出窗体后返回右上角,点击command2,label1停止移动

第二题:点击command1,在文本框text1内生成5个10-50以内的随机数,点击command2,在文本框text2内将text1内的5个数从小到大排序

第三题:点击command1,在文本框text3内显示text1*text2的结果(面积问题),并且text1和text2能分别检验数据的合法性(是否输入的是数字,而不是字母及其他)

跪求VB大神解答三题,高分悬赏!!!!!!!!!!小神跪了!!
第一题是返回左上角,亲!!

第一题:

Dim x As Long, y As Long

Private Sub Command1_Click()

    Timer1.Interval = 300

End Sub

Private Sub Command2_Click()

    Timer1.Interval = 0

End Sub

Private Sub Timer1_Timer()

    x = x + 100

    y = y + 100

    Label1.Left = x

    Label1.Top = y

    If Label1.Top > Form1.Height Or Label1.Left > Form1.Width Then

        x = 0

        y = 0

        Label1.Left = x

        Label1.Top = y

    End If

End Sub



第二题:

Dim a(1 To 5) As Integer

Private Sub Command1_Click()

    Dim i As Integer

    Dim s As String

    Randomize

    For i = 1 To 5

        a(i) = CInt((50 - 10 + 1) * Rnd + 10)

        s = s & CStr(a(i)) & " "

    Next

    Text1.Text = s

End Sub

Private Sub Command2_Click()

    Dim i As Integer, j As Integer, t As Integer, s As String

    For i = 1 To 4

        For j = i + 1 To 5

            If a(j) < a(i) Then

                t = a(i)

                a(i) = a(j)

                a(j) = t

            End If

        Next

    Next

    For i = 1 To 5

        s = s & CStr(a(i)) & " "

    Next

    Text2.Text = s

End Sub



第三题:

Private Sub Form_Load()

    Text1.Text = ""

    Text2.Text = ""

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

    If KeyAscii <> 46 Then

        If KeyAscii < 48 Or KeyAscii > 57 Then

            KeyAscii = 0

        End If

    End If

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)

    If KeyAscii <> 46 Then

        If KeyAscii < 48 Or KeyAscii > 57 Then

            KeyAscii = 0

        End If

    End If

End Sub

Private Sub Command1_Click()

    Text3.Text = Val(Text1.Text) * Val(Text2.Text)

End Sub

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-05-23
第一题是让label1慢慢的移动到右下角,还是瞬间移动到右下角?