2009-12-20 21 views
1

j'ai ce code:C# comment FormWindowState.Normal

private void aboutToolStripMenuItem_Click(object sender, EventArgs e) 
    { 
     this.WindowState = FormWindowState.Minimized; 
     about About = new about(); 
     About.ShowDialog(); 
    } 

minimise l'état de fenêtre parent réduit et affiche une forme de démarrage. Ma question est quand l'écran de démarrage se ferme comment puis-je revenir à parentwindowstate.normal?

Répondre

4
private void aboutToolStripMenuItem_Click(object sender, EventArgs e) 
{ 
    this.WindowState = FormWindowState.Minimized; 
    about About = new about(); 
    About.ShowDialog(); 
    this.WindowState = FormWindowState.Normal; 
} 
0

appel ShowDialog() comme ceci:

About.ShowDialog(this); 

Ensuite, dans le cas FormClosing du formulaire A propos, mettre:

this.Parent.WindowState = WindowState.Normal; 
+0

Ou après le ShowDialog() –

+0

Ou après le ShowDialog(): fonctionne. mais quand je l'essaie dans la forme à propos, il ne compile pas. Merci à tous pour votre aide. – iTEgg

+0

Duh à moi-même. Je suppose que c'est ce que vous obtenez quand vous essayez d'être l'arme la plus rapide de l'Ouest. –

1

Si vous utilisez ShowDialog au lieu de Afficher; vous pouvez ajouter

this.WindowState = FormWindowState.Normal; 

après l'appel ShowDialog. (ShowDialog bloque, contrairement à Show.)