Bonjour,

Pour faire simple j'ai une form avec un splitterContainer
A gauche j'ai un treeview qui sur un clic sur un niveau m'ouvre une form "fille" dans la partie de droite.

Tout marche bien, juste que je voudrais que si une form est déjà ouverte, qu'elle se remette au 1er plan.
Voici le code pour ouvrir mes fenêtres filles. Visiblement le "focus" ne suffit pas à la faire revenir en 1er

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
 Private Sub OuvertureForm(ByVal MonNoeud As TreeNode)
        If MonNoeud IsNot Nothing AndAlso MonNoeud.Name <> "-1|-1|-1|" & Guid.Empty.ToString Then
            'Vérifier que la fenêtre n'est pas déjà ouverte
            Dim PeutOuvrir As Boolean = True
            For Each frmOpen As frmWF In Me.SplitContainer1.Panel2.Controls
                If frmOpen.Tag.ToString = MonNoeud.Name Then
                    frmOpen.Focus()
                    PeutOuvrir = False
                    Exit For
                End If
            Next
 
            If PeutOuvrir Then
                Dim Param As String() = MonNoeud.Name.Split(CChar("|"))
                Dim Mesinfos As New Info
                Mesinfos.Societe = IIf(Param(0) <> "-1", Param(0), String.Empty).ToString
                Mesinfos.Site = IIf(Param(1) <> "-1", Param(1), String.Empty).ToString
                Mesinfos.Service = IIf(Param(2) <> "-1", Param(2), String.Empty).ToString
                Mesinfos.User = IIf(Param(3) <> Guid.Empty.ToString, Param(3), String.Empty).ToString
                Mesinfos.UserNom = MonNoeud.Text
                Mesinfos.TypeInfo = CInt(MonNoeud.Tag)
                Dim FormFille As New frmWF(Mesinfos)
                FormFille.WindowState = FormWindowState.Maximized
                FormFille.Tag = MonNoeud.Name
                FormFille.TopLevel = False
                FormFille.Parent = SplitContainer1.Panel2
                FormFille.Show()
            End If
        End If
    End Sub
frmopen.select ne fait rien non plus
J'ai vu "SendToBack" j'ai l'impression qu'il me faudrait le contraire
si quelqu'un voit comment faire