Discussion: userform
Afficher un message
Vieux 21/03/2004, 20h33   #2 (permalink)
michel
Guest
 
Messages: n/a
Par défaut Re: userform

bonjour David

si tu utilises Excel97 , tu peux ecrire

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

Private Declare Function EnableWindow Lib "User32" _
(ByVal hWnd As Long, ByVal bEnable As Long) As Long

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 Sub UserForm_Activate()
EnableWindow FindWindowA("XLMAIN", Application.Caption), 1
End Sub

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindowA(vbNullString, Me.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) Or &H20000
End Sub



pour les versions ulterieures d'Excel …. c'est plus simple

Sub lanceUSF()
UserForm1.Show 0
End Sub



bonne soirée
michel