Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Sub AddForm(Byval pForm as Form, byval pCloseOther as Boolean) Static lLst as New List(Of Form) If pCloseOther Then For Each lFrm As Form In lLst lFrm.Close Next lLst.Clear End If lLst.Add(pForm) End Sub
Private Sub FermerAutresFenetres() Dim fenetresAFermer As New List(Of Form) For Each frm As Form In My.Application.OpenForms If frm IsNot Me Then fenetresAFermer.Add(frm) End If Next For Each frm As Form In fenetresAFermer frm.Close() Next End Sub