|
-
Apr 25th, 2001, 10:20 AM
#1
Thread Starter
New Member
Set some text in picture box
Can I set a Text on a picture box without using labels or other controls.
------------------------------------------
Until next time,
------------------------------------------
-
Apr 25th, 2001, 01:52 PM
#2
Try this:
Code:
Private Sub Command1_Click()
Picture1.Print "Hello"
End Sub
-
Apr 25th, 2001, 02:14 PM
#3
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
-
Apr 26th, 2001, 02:54 AM
#4
Thread Starter
New Member
I alraedy had that in mind, but I want set the text on specific place
with X, Y points.
------------------------------------------
Until next time,
------------------------------------------
-
Apr 26th, 2001, 03:12 AM
#5
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
-
Apr 26th, 2001, 03:17 AM
#6
Thread Starter
New Member
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.
------------------------------------------
Until next time,
------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|