Results 1 to 10 of 10

Thread: Overlapping labels over an image box

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2013
    Posts
    33

    Overlapping labels over an image box

    I have 2 Doubts,

    First when i inserted a background image for my form1 it didn help me coz, whenever i run the program it used to flicker for 3 seconds and it looked ugly. How do i stop this from happening??
    I tried reducing the image resolution and the image size is only 350 kb. I used Jpeg.

    When nothing worked i removed the background image and instead used a picture box to insert the photo and i docked it to 'Full' now its working and the flickering is gone but all the labels that i had inserted have gone behind the picture box and nothing is visible.
    This is the last thing left in my project so please help me.

  2. #2
    Frenzied Member
    Join Date
    Oct 2012
    Location
    Tampa, FL
    Posts
    1,187

    Re: Overlapping labels over an image box

    did you try double buffering with your background image?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Overlapping labels over an image box

    Quote Originally Posted by Suraj S View Post
    When nothing worked i removed the background image and instead used a picture box to insert the photo and i docked it to 'Full' now its working and the flickering is gone but all the labels that i had inserted have gone behind the picture box and nothing is visible.
    Using the background image would be the better option if you can make that work but, if you can't, you can just right-click the PictureBox in the designer and select Send To Back. The image will then not show through the Labels though, because a transparent control displays its parent, not necessarily what's actually behind it. As such, you need to make the PictureBox the parent of the Labels. That can't be done in the designer but you can write some code to change the Parent in the Load event handler.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Member
    Join Date
    Mar 2013
    Posts
    33

    Re: Overlapping labels over an image box

    Quote Originally Posted by jayinthe813 View Post
    did you try double buffering with your background image?
    What is Double Buffering?? How do i do that??

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2013
    Posts
    33

    Re: Overlapping labels over an image box

    Quote Originally Posted by jmcilhinney View Post
    Using the background image would be the better option if you can make that work but, if you can't, you can just right-click the PictureBox in the designer and select Send To Back. The image will then not show through the Labels though, because a transparent control displays its parent, not necessarily what's actually behind it. As such, you need to make the PictureBox the parent of the Labels. That can't be done in the designer but you can write some code to change the Parent in the Load event handler.

    The Background is still flickiring, I used other photos as well, What code should i write to in the load even handler to change the parent?? Ad you mean load event of my form right?

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Overlapping labels over an image box

    Quote Originally Posted by Suraj S View Post
    The Background is still flickiring, I used other photos as well, What code should i write to in the load even handler to change the parent?? Ad you mean load event of my form right?
    That's the only Load event there is. What code do you think you should write? The control has a Parent property. What do you think the Parent is initially? What do you think the Parent should be?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Overlapping labels over an image box

    it's probably flickering because it's drawing the controls on the form... it might work better if the loading of the image is the LAST thing you do in the load event (as opposed to at design time).

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Overlapping labels over an image box

    it's probably flickering because it's drawing the controls on the form
    For 3 seconds? There's gotta be more to it than that!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  9. #9
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Overlapping labels over an image box

    probably true... we don't know how many lables, text boxes or other controls we're talking about... and yes, having an image in the background of the form will likely slowthings down... so 3 seconds? sure... we also don't know if it's flicker..........flicker.............. flicker....flicker........ flicker.....
    or of it's continuous flickering for that 3 seconds...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Overlapping labels over an image box

    In testing, adding 1000 labels dynamically with a maximised form using a 450kb, 600x600 jpg in stretch mode as a background creates a single fraction of a second visual blip. Subsequently minimising and restoring the form creates no flicker at all. If 3 seconds, in any variation, is correct then I'm gonna say there's more to this than meets the eye (in all senses of the phrase!)
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

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