P
pias
Guest
Rebonsoir, le forum
Pour éviter que les utilisateurs ne ferment un userform, je voudrais enlever la croix en haut à droite.
Je mets le code ci-dessus, mais il y a erreur.
Merci d'avance si quelqu'un trouve la solution.
a+
@pias
Private Declare Function GetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
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 Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", _
"X", "D") & "Frame", Me.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
End Sub
Private Sub UserForm_Activate()
UserForm1.Caption = Worksheets("config").Range("B3")
With TextBox1
.SetFocus ' Ce code pour sélectionner
.SelStart = 0
.SelLength = Len(TextBox1.Text)
End With
End Sub
Pour éviter que les utilisateurs ne ferment un userform, je voudrais enlever la croix en haut à droite.
Je mets le code ci-dessus, mais il y a erreur.
Merci d'avance si quelqu'un trouve la solution.
a+
@pias
Private Declare Function GetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
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 Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", _
"X", "D") & "Frame", Me.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF
End Sub
Private Sub UserForm_Activate()
UserForm1.Caption = Worksheets("config").Range("B3")
With TextBox1
.SetFocus ' Ce code pour sélectionner
.SelStart = 0
.SelLength = Len(TextBox1.Text)
End With
End Sub