vb Code:
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
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 Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Const DT_LEFT = &H0
Private Const DT_TOP = &H0
Private Const DT_WORDBREAK = &H10
Private Sub DrawOnPictureBox(ByRef PictBox As PictureBox, ByVal TxtStr As String)
Dim Rct As RECT
PictBox.Cls
SetRect Rct, 0, 0, PictBox.ScaleWidth, PictBox.ScaleHeight
DrawText PictBox.hdc, TxtStr, Len(TxtStr), R, DT_LEFT Or DT_TOP Or DT_WORDBREAK
End Sub
Private Sub Command1_Click()
DrawOnPictureBox Picture1, Text1.Text
End Sub