在窗体中建立一个文本框text1,multiline属性为true,scrollBars属性为2-vertical
复制进如下代码:
Private
Sub
Form_Load()
Dim
a&,
b$
For
a
=
100
To
200
If
a
Mod
3
=
0
Then
b
=
b
&
Str(a)
Next
a
Text1Text
=
b
End
Sub
---------我是华丽丽的分割线--------
dim
a(1
to
10)
as
long
dim
Temp()
as
long
‘保存能被3整除的数
dim
s
as
string
dim
n
as
integer
for
i=1
to
10
a(i)=inputbox("Please
input
data!")
next
i
for
i=1
to
10
if
(a(i)
mod
2)
then
n=n+1
s=s
&
cstr(a(i))
&
","
end
if
redim
temp(n)
as
long
dim
v
v=split(s,",")
for
i=0
to
ubound(v)
temp(i)=v(i)
next
i
Sub Arr()
Dim Arr(1 To 4, 1 To 3) As Integer
Dim ArrX As Integer, ArrY As Integer
Dim MaxArr As Integer
For i = 1 To 4
For j = 1 To 3
2000:
n = InputBox("请输入整数")
If IsNumeric(n) = False Then
MsgBox "输入错误!请重新输入!"
GoTo 2000
End If
If n <> CInt(n) Then
MsgBox "输入错误!请重新输入!"
GoTo 2000
End If
Arr(i, j) = n
If n > MaxArr Then
MaxArr = n
ArrX = i
ArrY = j
End If
If j < 3 Then
Print Arr(i, j);
Else: Print Arr(i, j)
End If
Next
Next
Print "最大值是:" & MaxArr
Print "行坐标X:" & ArrX
Print "列坐标Y:" & ArrY
End Sub
以上就是关于用VB编写程序全部的内容,包括:用VB编写程序、用VB编一程序、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)