简单的VB代码

来源:百度知道 编辑:UC知道 时间:2024/05/05 00:49:47
求一些简单的初二的VB代码!!!!!!!!要详细,最好配解释

有你用的 自己找吧
我以前做的
Option Explicit
Dim i1 As Integer, j1 As Integer
Dim str1 As String
Private Sub diaoy(x As Integer, y As Integer)
Dim t As Integer
'cmd10的程序
t = x: x = y: y = t
End Sub

Private Function FindMax(a() As Integer)
Dim start As Integer, finish As Integer, i As Integer, max As Integer
start = LBound(a)
finish = UBound(a)
max = a(start)
For i = start To finish
If a(i) > max Then max = a(i)
Next i
FindMax = max
'数组元素的函数

End Function

Private Sub cmd1_Click()
Dim b(5) As Integer, i%, c%
b(0) = 12: b(1) = 58: b(2) = 98: b(3) = 67: b(4) = 49: b(5) = 24
c = FindMax(b())
Print c

End Sub

Private Sub Command1_Click()
Dim i1 As Integer, j1 As Integer
For i1 = 1 To 9
For j1 = 1 To i1
Print Tab(j1 * 8); i1 & "*" & j1 & "=" & i1 *