AW: Fenster schließen!
05.11.2005 00:37:08
Schwab
Hierfür musst du folgenden Code einfügen:
[code]
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "User32" ( _
ByVal hWnd As Long) As Long
Private Const GWL_STYLE = -&H10
Private Const WS_SYSMENU = &H80000
Private Sub UserForm_Activate()
Dim lHwnd As Long
lHwnd = FindWindow("ThunderDFrame", Me.Caption)
SetWindowLong lHwnd, GWL_STYLE, GetWindowLong(lHwnd, GWL_STYLE) And Not WS_SYSMENU
DrawMenuBar lHwnd
End Sub
[/code]
Dann wird das X usw. ausgeblendet.
Beim erstellen der Userform wird es zwar noch angezeigt, aber beim ausführen nicht.
Jetzt kannst du einfach eine selbsterstellte Grafik einfügen und ihr dann z.B. das Ereignis "hide" hinzufügen beim Click darauf.
So mache ich es eigentlich immer, ist easy :)
Gruß
Schwab