masquer le bouton fermer

kuhn

XLDnaute Nouveau
Bonjour,

Je souhaite masquer le bouton fermer de mon UserForm

Est-ce possible ?

Merci

Nicolas
 

CB60

XLDnaute Barbatruc
Re : masquer le bouton fermer

Bonsoir
cela doit suffire

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = True
End Sub

à mettre dans l'USF ( ce n'est pas de moi )

Ou d'évelyne et François
Tu as aussi la solution de supprimer tout simplement cette croix rouge
merci à son créateur !!!!!!!!!!!

Private Sub UserForm_Initialize()
Pasdecroix Me
End Sub
__________________________________
puis dans un module
__________________________________
Option Private Module
Declare Function GetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long


Sub Pasdecroix(USF As UserForm)
Dim hWnd As Long
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", _
"X", "D") & "Frame", USF.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
End Sub


bonne soirée
E et F
 

Georgio

XLDnaute Nouveau
Re : masquer le bouton fermer

Slt Kuhn
On m'aide donc j'aide,je t'ai vite fait bien fait copié ce code qui marche chez moi.
A toi de jouer a+
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
MsgBox "Action impossible !!"
Cancel = True
End If
End Sub
 

Discussions similaires

  • Question
Microsoft 365 Listbox
Réponses
3
Affichages
282
Réponses
22
Affichages
792

Statistiques des forums

Discussions
312 765
Messages
2 091 892
Membres
105 084
dernier inscrit
lca.pertus