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.
Re: Overlapping labels over an image box
did you try double buffering with your background image?
Re: Overlapping labels over an image box
Quote:
Originally Posted by
Suraj S
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.
Re: Overlapping labels over an image box
Quote:
Originally Posted by
jayinthe813
did you try double buffering with your background image?
What is Double Buffering?? How do i do that??
Re: Overlapping labels over an image box
Quote:
Originally Posted by
jmcilhinney
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?
Re: Overlapping labels over an image box
Quote:
Originally Posted by
Suraj S
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?
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
Re: Overlapping labels over an image box
Quote:
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!
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
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!)