|
-
Jan 6th, 2003, 03:56 PM
#1
Thread Starter
Hyperactive Member
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).
-
Jan 6th, 2003, 03:59 PM
#2
Frenzied Member
Try this
VB Code:
Private Sub Label1_Click()
Call Picture1_Click
End Sub
Last edited by seaweed; Jan 6th, 2003 at 04:08 PM.
~seaweed
-
Jan 6th, 2003, 04:03 PM
#3
Thread Starter
Hyperactive Member
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.
-
Jan 6th, 2003, 04:07 PM
#4
Frenzied Member
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:
Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Picture1_MouseUp(Button, Shift, X, Y)
End Sub
-
Jan 6th, 2003, 04:10 PM
#5
Thread Starter
Hyperactive Member
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.
-
Jan 6th, 2003, 04:16 PM
#6
Frenzied Member
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:
Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Picture1_MouseUp(Button, Shift, Label1.Left + X, Label1.Top + Y)
End Sub
-
Jan 6th, 2003, 04:32 PM
#7
Thread Starter
Hyperactive Member
Okay, I guess I will just do something like that. Thanks!
-
Jan 6th, 2003, 06:04 PM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|