|
-
Jun 20th, 2007, 10:59 PM
#1
Thread Starter
New Member
[2005] fade in a form while fading out another
I have two forms, one called logofade and mainmenu. I am fading in the logofade by using a timer event that increases the opacity. Once the opacity reaches 100% I then want the logofade to fade back to 0% and reveal the mainmenu form that I made visible when the logofade had reached 100%. It works great, except when I make the mainmenu visible it causes a noticable blink on the screen when the visible property is set to true. This happens even though the logofade has focus and the mainmenu is made visible behind it. Does anyone know a trick that I can try so I can get rid of the blinking thing. I have tried to increase the opacity of the mainmenu while decreasing the opacity of the logofade, but the opacity change on the mainmenu does not have any effect until it gets focus.
Any ideas?
Eric
-
Jun 20th, 2007, 11:23 PM
#2
Re: [2005] fade in a form while fading out another
Using a Timer for that is not ideal. There is a Windows API function specifically for the purpose. Use the FormAnimator class from this thread and then all you'll have to do is call Show and Close on the forms as normal and the AnimateWindow API inside the FormAnimator class will take care of the rest. I'm not 100% sure it will alleviate your current issue but it's a preferable method regardless.
-
Jun 21st, 2007, 12:59 AM
#3
Re: [2005] fade in a form while fading out another
i've been told by others that the blink can be alleviated by actually showing both forms at the beginning 100% transparency. The blink is caused by the 2nd form showing, although invisible. Once they are both shown (but invisible) you won't have any odd blinks. Make the mainmenu visible when you are ready by setting it's opacity to 100% BUT here's the question: How is your app going to behave under the vista Aero interface? It automatically fades in forms. You might find your form fading in twice!
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
|