展开全部
好久没写VB啦
好怀念,
先创建一个from把autoRedraw设置为True
然后贴入以下代码
Private Sub Form_Load()
Dim Length As Integer
Dim Width As Integer
Dim i As Integer
Dim j As Integer
Dim Space As String
Dim Ascii As Integer
Dim Str As String
Ascii = 65
Width = 1
Space = ""
Length = InputBox("输入长度:")
For i = 1 To Length
Space = Space & " "
Next
For i = 1 To Length
Str = ""
For j = 1 To Width
Str = Str & Chr(Ascii)
Next
Print Space & Str
If i < Length Then
Space = Mid(Space, 1, Len(Space) - 1)
Ascii = Ascii + 1
Width = Width + 2
End If
Next
For i = 1 To Length
Space = Space & " "
Ascii = Ascii - 1
Width = Width - 2
Str = ""
For j = 1 To Width
Str = Str & Chr(Ascii)
Next
Print Space & Str
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询