Reputation: 8534
When I call "this.close()" to pass to another page. That effect of closing, and for a second no pages are displayed. How can I fix that please?
For example:
Game game = new Game();
game.show();
this.close();
When I call this.close(), for a second there is an effect of no pages displayed. I would like and effect similar of browsers.
Upvotes: 0
Views: 171
Reputation: 1705
In Windows 7, the Aero effect causes windows to fade in and out on show and close. This was an issue for one of the applications I inherited development in, and I resolved my issue by moving away from having separate forms that simply replaced each other on the screen. My WPF experience is limited, so you may have to interpret my solution:
I converted all the form objects in the program into separate UserControls. My Base Form had an ActiveScreen property that looked a little like this:
// Code is untested
public Control ActiveScreen
{
get { return _screen; }
private set
{
this.Controls.Remove(_screen);
_screen = value;
_screen.Dock = DockStyle.Fill;
_screen.Size = this.ClientRectangle.Size; // So that control draws correctly the first time.
this.Controls.Add(_screen);
}
}
After doing a quick search, there are certainly other ways to get around the Aero effect: Disable aero fade-in effect on dialog
Upvotes: 1