答案:
代码如下:自己注意修改各控件的名称
Const mLen = 100 '移动步长值
Const mVMin = 500 '慢速
Const mV = 250 '中速
Const mVMax = 10 '快速
Private Sub ChFonB_Click()
Label1.FontBold = IIf(ChFonB.Value = 0, False, True)
End Sub
Private Sub ChFonI_Click()
Label1.FontItalic = IIf(ChFonI.Value = 0, False, True)
End Sub
Private Sub ChFonU_Click()
Label1.FontUnderline = IIf(ChFonU.Value = 0, False, True)
End Sub
Private Sub Form_Load()
'初始化
Timer1.Interval = mVMin
With Label1
.FontName = OpFonS.Font.Name
.FontSize = OpFonSizeMin.FontSize
End With
Label1.Top = (Me.Height - Frame1(0).Height) / 3
End Sub
Private Sub OpFonH_Click()
Label1.FontName = OpFonH.Font.Name
Label1.Top = (Me.Height - Frame1(0).Height) / 3
End Sub
Private Sub OpFonK_Click()
Label1.FontName = OpFonK.Font.Name
Label1.Top = (Me.Height - Frame1(0).Height) / 3
End Sub
Private Sub OpFonS_Click()
Label1.FontName = OpFonS.Font.Name
Label1.Top = (Me.Height - Frame1(0).Height) / 3
End Sub
Private Sub OpFonSize_Click()
Label1.FontSize = OpFonSize.FontSize
Label1.Top = (Me.Height - Frame1(0).Height) / 3
End Sub
Private Sub OpFonSizeMax_Click()
Label1.FontSize = OpFonSizeMax.FontSize
Label1.Top = (Me.Height - Frame1(0).Height) / 3
End Sub
Private Sub OpFonSizeMin_Click()
Label1.FontSize = OpFonSizeMin.FontSize
Label1.Top = (Me.Height - Frame1(0).Height) / 3
End Sub
Private Sub OpV_Click()
Timer1.Interval = mV
End Sub
Private Sub OpVMax_Click()
Timer1.Interval = mVMax
End Sub
Private Sub OpVMin_Click()
Timer1.Interval = mVMin
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + mLen
If Label1.Left >= Me.Width Then Label1.Left = -Label1.Width
End Sub
=====================
Dim a(59) As Long
Dim b() As Long
Private Sub Command1_Click()
Dim i As Long
Dim s As Long
'产生60个100-200的随机整数
s = 0
For i = 0 To 59
a(i) = Int((200 * Rnd) + 100)
If (a(i) Mod 2) = 0 Then
ReDim Preserve b(s)
b(s) = a(i)
s = s + 1
End If
Next i
'输出60个随机整数
s = 0
For i = 0 To 59
Text1 = Text1 & a(i) & " "
s = s + 1
If s = 10 Then
s = 0
Text1 = Text1 & vbCrLf
End If
Next i
'输出其中的偶数
s = 0
For i = 0 To UBound(b) - 1
Text2 = Text2 & b(i) & " "
s = s + 1
If s = 10 Then
s = 0
Text2 = Text2 & vbCrLf
End If
Next i
End Sub
这个简单,
孩子,洗洗睡吧