永发信息网

VB 非常急!用循环语句分别显示下面的图案

答案:1  悬赏:40  手机版
解决时间 2021-08-24 03:10
  • 提问者网友:捧腹剧
  • 2021-08-23 22:29
VB 非常急!用循环语句分别显示下面的图案
1
5 1 6 1 7 12345 8 54321
12 21 1234 4321
123 321 123 321
1234 4321 12 21
12345 54321 1 1
8个按钮显示8个图形在picturebox上
最佳答案
  • 五星知识达人网友:何以畏孤独
  • 2021-08-23 23:29

Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 5
If i 5 Then
Picture1.Print Space((i - 1) * 2); String(8 - ((i - 1) * 2),*)
Else
Picture1.Print Space(7); *
End If
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer
For i = 1 To 5
Picture2.Print String(2 * i - 1,*)
Next
End Sub
Private Sub Command3_Click()
Dim i As Integer
For i = 0 To 4
Picture3.Print Spc(i); String(9,*)
Next
End Sub
Private Sub Command4_Click()
Dim i As Integer
For i = 4 To 0 Step -1
Picture4.Print Spc(i); String(9,*)
Next
End Sub
Private Sub Command5_Click()
Dim i As Integer,j As Integer,m As String
For i = 1 To 5
m =
For j = 1 To i
m = m + Trim(Str(j))
Next
Picture5.Print m
Next
End Sub
Private Sub Command6_Click()
Dim i As Integer,j As Integer,m As String
For i = 1 To 5
m =
For j = i To 1 Step -1
m = m + Trim(Str(j))
Next
Picture6.Print m
Next
End Sub
Private Sub Command7_Click()
Dim i As Integer,j As Integer,m As String
For i = 5 To 1 Step -1
m =
For j = 1 To i
m = m + Trim(Str(j))
Next
Picture7.Print m
Next
End Sub
Private Sub Command8_Click()
Dim i As Integer,j As Integer,m As String
For i = 5 To 1 Step -1
m =
For j = i To 1 Step -1
m = m + Trim(Str(j))
Next
Picture8.Print m
Next
End Sub
完毕,
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯