Results 1 to 6 of 6

Thread: label on top of a picture box does not display the caption at run time

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31

    label on top of a picture box does not display the caption at run time

    hi! I am trying to create my own custom component for displaying and scrolling text. The way I am trying to achieve this is by having a PictureBox so I can set it's picture to whatever image I wish to to. I have 4 labels added on top of the textbox and the text is visible in the design mode but when I run the project the text is not displayed.
    Can somebody please tell me why that is and if there is a way to display text on a textbox or form without making use of labels?!

    Thank you
    Why did I ever start learning VB?! I should have been happy with Java.

  2. #2
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Check the Z-Order property of the label and set it so that the label is on top of any other window.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31
    I am using vb6 and I did not find the property Z-Order.
    Why did I ever start learning VB?! I should have been happy with Java.

  4. #4
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    It is only available at run time. So, change it in the Form_Load event. It's a function not a property though.

  5. #5
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    I'm not sure what the textbox part came from since you were talking about labels, but you won't be able to actually make them appear over other things. Since they aren't really windows, they are painted directly onto the form, so any control sitting on the form will already be over top of them. Is there a reason why you didn't want to use labels in the first place (since you asked for a way around that at the very end of your post)? There is a way around it though. What you may have done when making your control is not actually make the labels be contained within the picturebox. If you make sure to draw the labels inside the picturebox when it is selected (just click on it once, then select the label tool and draw it in), it will be contained within that window. Then if you have a picture inside the picturebox, it will be painted in, and then the label text will go over it (make the label's .BackStyle property transparent). That should give you the effect you're describing if I understood you correctly.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31
    I got it working with labels - thanks a lot
    Why did I ever start learning VB?! I should have been happy with Java.

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