Results 1 to 8 of 8

Thread: Text over object?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259

    Text over object?

    I have a picturebox (gameboard) and I want to place lables on top of sections of the board. However, I want them to not "overlap" the board, in the sense that it triggers the label click, and not the board click.

    What can i do so that even if I click on the label, it doesn't have a click event, instead it triggers the picturebox click. (The shape object is a perfect example).
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Try this

    VB Code:
    1. Private Sub Label1_Click()
    2.     Call Picture1_Click
    3. End Sub
    Last edited by seaweed; Jan 6th, 2003 at 04:08 PM.
    ~seaweed

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    in my picture_1 click event, I use the X, Y coord details. If I call it after the label click, these details are not valid.
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  4. #4
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357
    I don't think the click event takes X and Y coordinates. If you are using the MouseUp event, then call it from the similar event of the label, i.e.
    VB Code:
    1. Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     Call Picture1_MouseUp(Button, Shift, X, Y)
    3. End Sub
    ~seaweed

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    Will my X and Y coordinates not be either:
    a) x,y of the label
    b) x,y of the form

    if my label is say, in the center of the picturebox, thats a problem.
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  6. #6
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Try this

    I don't have this in front of me, so you will probably have to play with it a little, but this might work:
    VB Code:
    1. Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     Call Picture1_MouseUp(Button, Shift, Label1.Left + X, Label1.Top + Y)
    3. End Sub
    ~seaweed

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    Okay, I guess I will just do something like that. Thanks!
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  8. #8
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    If the Label is disabled its container will receive the Mouse events however, the caption color is always "grayed out".

    You can easily use a Shape control. Just print whatever text you want on the PictureBox - something like.

    Picture1.CurrentX = Shape1.Left
    Picture1.CurrentY = Shape1.Top
    Picture1.Print "This is a test."

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