G
Guest
We are trying to use basic windows forms to do "fancy" transitions on our
application. When switching between main form controls (docked to full), we
want to make it look like one is fading out and the other fading in. Since
the UserControls don't support 'Opacity' I built a transition panel that
shows a modal form (with internal timer) that fades out, then back in when
the next control is shown. The Transition form is shown over the area of the
main form's child controls.
It functions as expected, however when the transition form hits opacity 1.0
(goes from 0 to 1, to 0 again to simulate fading out then back in), I get a
flash of black once before it starts to fade back to 0 opacity.
The backcolor and forecolor are set to white. I have overriden
OnPaintBackground, but it isn't being called. It definitely seems like the
parent is refreshing (because I change the control states of the main control
to visible at the mid fade point) and causing the modal dialog to repaint
black.
If it flashed white, I would be OK with that, but I would prefer it to
always repaint the current screen. In MFC and C++ I recall that you could
setup the default brush for erasing. Not sure if there is a .NET equivalent.
I do have a picture box on the form. Is it possible that it's
OnPaingBackground is causing the flash?
Any thougths would be helpful. I am sure I am missing some vital step here.
application. When switching between main form controls (docked to full), we
want to make it look like one is fading out and the other fading in. Since
the UserControls don't support 'Opacity' I built a transition panel that
shows a modal form (with internal timer) that fades out, then back in when
the next control is shown. The Transition form is shown over the area of the
main form's child controls.
It functions as expected, however when the transition form hits opacity 1.0
(goes from 0 to 1, to 0 again to simulate fading out then back in), I get a
flash of black once before it starts to fade back to 0 opacity.
The backcolor and forecolor are set to white. I have overriden
OnPaintBackground, but it isn't being called. It definitely seems like the
parent is refreshing (because I change the control states of the main control
to visible at the mid fade point) and causing the modal dialog to repaint
black.
If it flashed white, I would be OK with that, but I would prefer it to
always repaint the current screen. In MFC and C++ I recall that you could
setup the default brush for erasing. Not sure if there is a .NET equivalent.
I do have a picture box on the form. Is it possible that it's
OnPaingBackground is causing the flash?
Any thougths would be helpful. I am sure I am missing some vital step here.