求助:一个关于VB的题!
在窗体模块中自定义一个Sub过程,按给定的不同字符及行数在图片框中打印行数相同。运行时,单击图片框,用InputBox输入任一字符及行数,调用该过程打印图形。具体的窗体要...
在窗体模块中自定义一个Sub过程,按给定的不同字符及行数在图片框中打印行数相同。运行时,单击图片框,用InputBox输入任一字符及行数,调用该过程打印图形。
具体的窗体要怎么设计? 展开
具体的窗体要怎么设计? 展开
2个回答
展开全部
'直接在窗体上添加一个图片框Picture1,调整其大小合适
Private Sub Picture1_Click()
Dim S As String, T As Integer
S = InputBox("请输入要打印的字符", , "☆")
T = InputBox("请输入要打印的行数", , 10)
PrintT S, T
End Sub
Private Sub PrintT(S As String, T As Integer)
Dim I As Integer, J As Integer
For I = 1 To T
Picture1.Print Space(I - 1);
For J = 1 To T
Picture1.Print S;
Next J
Picture1.Print
Next I
End Sub
Private Sub Picture1_Click()
Dim S As String, T As Integer
S = InputBox("请输入要打印的字符", , "☆")
T = InputBox("请输入要打印的行数", , 10)
PrintT S, T
End Sub
Private Sub PrintT(S As String, T As Integer)
Dim I As Integer, J As Integer
For I = 1 To T
Picture1.Print Space(I - 1);
For J = 1 To T
Picture1.Print S;
Next J
Picture1.Print
Next I
End Sub
展开全部
Private Sub Command1_Click()
Dim xx, yy
xx = InputBox("输入任一字符及行数" + vbCrLf + "(w,12)", "提示:", "w,12")
yy = Split(xx, ",")
For i = 1 To yy(1)
Print String(i, " ") + String(yy(1), yy(0))
Next
End Sub
我的简单
你修改下吧
Dim xx, yy
xx = InputBox("输入任一字符及行数" + vbCrLf + "(w,12)", "提示:", "w,12")
yy = Split(xx, ",")
For i = 1 To yy(1)
Print String(i, " ") + String(yy(1), yy(0))
Next
End Sub
我的简单
你修改下吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询