Comment fait ton pour fermer une userform

  • Initiateur de la discussion bichon
  • Date de début
B

bichon

Guest
Salut j'aimerai savoir le code pour fermer une userform et non pas la cacher
mais la fermer comment ce code pourrait s'ecrire merci

bichon
 
P

petchy

Guest
Le Forum
Helderregarde si ça te va, tu supprime la croix pour la fermeture de ton USF mais n'oublis pas de lui mettre un bouton de commande pour fermé
ENLEVER LA CROIX DU USF
Option Explicit

Private Declare Function SetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long

Private Sub UserForm_Initialize()
Dim hWnd As Long
'''''''''''initialisation des controles

'enlève la croix
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", _
"X", "D") & "Frame", Me.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
End Sub

Petchy.gif
 

Statistiques des forums

Discussions
312 763
Messages
2 091 815
Membres
105 076
dernier inscrit
simeand