vb...............会的速来啊

来源:百度知道 编辑:UC知道 时间:2024/06/08 01:07:45
功能为当单击“显示”按钮时,程序根据文本框中内容,按下图格式显示图案。
Private Sub Command1_Click()
Dim Slen As Integer
Dim i As Integer
Dim j As Integer

Str = Text1
Slen = Str
Picture1.Cls
For i = 1 To Slen
Picture1.Print Space(i);
Picture1.Print Mid(Str, 1, 1)
End
End Sub
我只是想大家把这个的错误找出来,然后更正!!!!
https://gss0.baidu.com/7LsWdDW5_xN3otqbppnN2DJv/liqihua1990091/pic/item/d6bc98fa79cde49d9e5146b4.jpg

可以中英文混输
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
Private Sub Command1_Click()
Dim Slen As Integer
Dim i As Integer
Dim j As Integer

s = Text1.Text
Slen = Len(s)
Picture1.Cls
For i = 1 To Slen
Picture1.Print Space(lstrlen(Left(s, Len(s) - i) & Chr(0))); Right(s, i)
Next
End Sub