The first time you change the opacity on a form (through code) the screen flickers, but any subsequent opacity changes while the form is still alive are smooth. Why is this
Im trying to write some simple code to fade my app out when it closes:
For i = 1.0 To 0.01 Step -0.05
Me.Opacity = i
Application.DoEvents()
Next
End
Works beautifully but it looks bad because the screen flickers before it starts fading... ive tried using Lockwindow api to try and stop it but it didnt work, it works smoothly if i put this code in form_load:
Me.Opacity = 0.9
Me.Opacity = 1
But the problem there is i get flicker when the form loads up... is there any way around this Im a perfectionist... this is unacceptable! :P

Preventing screen flicker when using opacity
Bezpol
I'm having the same problem. Did you ever find a solution
I'm using Visual Studio 2005 Beta 1. When an exception is unhandled and you are thrown into the debugger, the window that shows the problem (the one with the leader drawn pointing to the line of offending code) becomes transparent while you drag it around. I noticed that this window also has the flickering problem.
However, when you move controls around using the Windows Forms designer, these are also transparent while being dragged, but there is no flicker, which leads me to believe that there is a solution to be found, if only we can find it!
Regards,
Yellow Banana.
Turnbuckle
Frank
Rob G
Use a Timer instead! At least if you are a perfectionist who wants your code to be up-to-date with the 1990's... sorry... 2000's...
Second: Try setting the opacity to something like 99% in design-time to make it layered from the beginning. Then in the Load event you set it right up to 100%.