Can I set a Text on a picture box without using labels or other controls.
Printable View
Can I set a Text on a picture box without using labels or other controls.
Try this:
Code:Private Sub Command1_Click()
Picture1.Print "Hello"
End Sub
If you want the Text to be part of the picture, then make sure you set the Picture to the Image.
Code:Picture1.Picture = Picture1.Image
I alraedy had that in mind, but I want set the text on specific place
with X, Y points.
Hi Inergy , where do you get yours ??
Try the following api call
Declare Function TextOut Lib "gdi32.dll" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, _
ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
in some event put this code, it places the text in your picture on 100,100 (x,y)
strTxt = "Hello"
a = Len(strTxt)
Left = 100
Top = 100
retval = TextOut(picture1.hdc, Left, Top, strTxt, a)
C A Swatty
Very nice swatty,
But can I scale the size of this text, or set a font to this text.
I want to this when my picture change size.