|
-
May 2nd, 2013, 06:08 AM
#1
Thread Starter
Member
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.
-
May 2nd, 2013, 08:17 AM
#2
Re: Overlapping labels over an image box
did you try double buffering with your background image?
-
May 2nd, 2013, 08:35 AM
#3
Re: Overlapping labels over an image box
 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.
-
May 3rd, 2013, 12:44 AM
#4
Thread Starter
Member
Re: Overlapping labels over an image box
 Originally Posted by jayinthe813
did you try double buffering with your background image?
What is Double Buffering?? How do i do that??
-
May 3rd, 2013, 12:47 AM
#5
Thread Starter
Member
Re: Overlapping labels over an image box
 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?
-
May 3rd, 2013, 04:24 AM
#6
Re: Overlapping labels over an image box
 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?
-
May 3rd, 2013, 11:05 AM
#7
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
-
May 3rd, 2013, 11:10 AM
#8
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!
-
May 3rd, 2013, 11:30 AM
#9
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
-
May 3rd, 2013, 11:50 AM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|