2个回答
展开全部
画一个按钮,调用inputbox
Private Sub Command1_Click()
Dim i As Integer, j As Integer, n As Integer
n = InputBox("n=", "请输入一个数值n")
For i = 1 To n Step 1
For j = 1 To 2 * i - 1 Step 2
Print "*";
Next j
Print
Next i
End Sub
或者画出一个文本框:
Private Sub Text1_Change()
Dim i As Integer, j As Integer, n As Integer
n = Val(Text1.Text)
For i = 1 To n Step 1
For j = 1 To 2 * i - 1 Step 2
Print "*";
Next j
Print
Next i
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, n As Integer
n = InputBox("n=", "请输入一个数值n")
For i = 1 To n Step 1
For j = 1 To 2 * i - 1 Step 2
Print "*";
Next j
Next i
End Sub
或者画出一个文本框:
Private Sub Text1_Change()
Dim i As Integer, j As Integer, n As Integer
n = Val(Text1.Text)
For i = 1 To n Step 1
For j = 1 To 2 * i - 1 Step 2
Print "*";
Next j
Next i
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询