如何在vb的窗体中并排输入两个矩阵?

我的程序如下,但ABCD四个矩阵都是竖排排列的,我想让AB并列,CD并列,请问该怎么改?OptionBase1PrivateSubForm_load()Dima(3,4)... 我的程序如下,但ABCD四个矩阵都是竖排排列的,我想让AB并列,CD并列,请问该怎么改?
Option Base 1
Private Sub Form_load()
Dim a(3, 4) As Integer, b(3, 4) As Integer, c(3, 4) As Integer, d(3, 4) As Integer
Show
For i = 1 To 3
For j = 1 To 4
a(i, j) = Int(89 * Rnd + 10)
Next j
Next i

Print "A矩阵为:"
Print
For i = 1 To 3
For j = 1 To 4
Print Tab(5 * j); a(i, j);
Next j
Print
Next i
For i = 1 To 3
For j = 1 To 4
b(i, j) = Int(10 * Rnd + 0)
Next j
Next i
Print "B矩阵为:"
Print
For i = 1 To 3
For j = 1 To 4
Print Tab(5 * j); b(i, j);
Next j
Print
Next i

Print "C矩阵为:"
Print
For i = 1 To 3
For j = 1 To 4
c(i, j) = a(i, j) + b(i, j)

Print Tab(5 * j); c(i, j);
Next j
Print
Next i

Print "D矩阵为:"
Print
For i = 1 To 3

For j = 1 To 4
d(i, j) = a(i, j) - b(i, j)

Print Tab(5 * j); d(i, j);
Next j
Print
Next i

End Sub
展开
 我来答
gaphy2010
2011-05-03 · TA获得超过5848个赞
知道小有建树答主
回答量:786
采纳率:0%
帮助的人:829万
展开全部
参考这个:
Option Base 1

Private Sub Form_load()
Dim a(3, 4) As Integer, b(3, 4) As Integer, c(3, 4) As Integer, d(3, 4) As Integer
Show
Print "A矩阵为:", "", "B矩阵为:"
For i = 1 To 3
For j = 1 To 4
a(i, j) = Int(89 * Rnd + 10)
b(i, j) = Int(10 * Rnd + 0)
Next j
Print a(i, 1); a(i, 2); a(i, 3), "", b(i, 1); b(i, 2); b(i, 3)
Next i

End Sub
更多追问追答
追问
可是AB矩阵不是随机的了,变成了固定不变的
追答
Option Base 1

Private Sub Form_load()
Randomize '加上这个
Dim a(3, 4) As Integer, b(3, 4) As Integer, c(3, 4) As Integer, d(3, 4) As Integer
Show
Print "A矩阵为:", "", "B矩阵为:"
For i = 1 To 3
For j = 1 To 4
a(i, j) = Int(89 * Rnd + 10)
b(i, j) = Int(10 * Rnd + 0)
Next j
Print a(i, 1); a(i, 2); a(i, 3), "", b(i, 1); b(i, 2); b(i, 3)
Next i

End Sub
03dkp4pcf
2011-05-03 · TA获得超过1121个赞
知道小有建树答主
回答量:1374
采纳率:0%
帮助的人:800万
展开全部
使用vscroll和hscroll控件,在其SCOLL事件中加入代码,举例如:
dim x as control
for each x in form1.controls
x.top=x.top+1
next
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式