Bonjour à tous,

Quelqu'un peut m'expliquer pourquoi après un appel à un SaveFileDialog, si je fait un ShowDialog, la fenêtre passe en arrière plan !!!

Exemple de test pour reproduire le bug:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
using System;
using System.Collections.Generic;
using System.Windows.Forms;
 
namespace BugSaveDialog
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
 
            using (Form f1 = new Form())
            {
                f1.ShowDialog();
            }
 
            using (SaveFileDialog saveForm = new SaveFileDialog())
            {
                saveForm.ShowDialog();
            }
 
            using (Form f2 = new Form())
            {
                f2.ShowDialog();
            }
 
        }
    }
}
Comment faire pour que f2 soit au premier plan ? (je crois que BringToFront ne marche pas...)
Et par curiosité Pourquoi ca fait ca ??


merci !

Edit
je suis pas le seul à avoir rencontré le problème:
http://www.developpez.net/forums/d61...an-showdialog/