Results 1 to 6 of 6

Thread: Set some text in picture box

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Belgium
    Posts
    6

    Set some text in picture box

    Can I set a Text on a picture box without using labels or other controls.
    ------------------------------------------
    Until next time,
    ------------------------------------------

  2. #2
    Matthew Gates
    Guest
    Try this:


    Code:
    Private Sub Command1_Click()
        Picture1.Print "Hello"
    End Sub

  3. #3
    Megatron
    Guest
    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Belgium
    Posts
    6

    Red face

    I alraedy had that in mind, but I want set the text on specific place
    with X, Y points.
    ------------------------------------------
    Until next time,
    ------------------------------------------

  5. #5
    Swatty
    Guest

    Lightbulb

    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

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Belgium
    Posts
    6
    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
  •  



Click Here to Expand Forum to Full Width