Results 1 to 3 of 3

Thread: [2005] fade in a form while fading out another

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    2

    [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

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

    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.
    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

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    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!
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

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