1个回答
展开全部
Private Sub Command1_Click()
CurrentY = 0
For i = 1 To 9
If i <= 5 Then
Print Space(9 - i);
For j = 1 To 2 * i - 1
Print "*";
Next j
Else
Print Space(i - 1);
For j = 1 To 2 * (10 - i) - 1
Print "*";
Next j
End If
Next i
End Sub
Private Sub Command2_Click()
CurrentY = 0
Dim a(8) As String, b(8) As String
For i = LBound(a) To UBound(a)
If i <= 4 Then
a(i) = String(2 * i + 1, "*")
b(i) = Space(25 - i)
Else
a(i) = String(2 * (8 - i) + 1, "*")
b(i) = Space(17 + i)
End If
Print b(i) + a(i)
Next i
End Sub
Private Sub Command3_Click()
CurrentY = 0
For i = 1 To 9
If i <= 5 Then
Print Space(43 - i);
Print String(2 * i - 1, "*")
Else
Print Space(33 + i);
Print String(2 * (10 - i) - 1, "*")
End If
Next i
End Sub
Private Sub Form_Load()
Me.Width = 4800
Me.Height = 2640
Command1.Width = 1245: Command1.Height = 315: Command1.Left = 120: Command1.Top = 1830
Command2.Width = 1245: Command2.Height = 315: Command2.Left = 1635: Command2.Top = 1830
Command3.Width = 1245: Command3.Height = 315: Command3.Left = 3150: Command3.Top = 1830
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询