picture1.print "123216545613214687654321357435434132132"
当picture宽度不够时候后面的就没有显示了
如何用简单的方法能实现自动折行
Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Private Sub Command1_Click()
s = "123216545613214687一二三四五六七八九十12345678901234567890123456789012345678901234567890一二三四五六七八九十"
With Picture1
For i = 1 To Len(s)
If .TextWidth(Mid(s, 1, i)) > .Width Then
Picture1.Print Mid(s, 1, i - 1)
s = Mid(s, i): i = 1
End If
Next
End With
If s <> "" Then Picture1.Print s
End Sub
Private Sub Form_Load()
Picture1.Width = 3000
End Sub