bitte wieder einmal um Eure Hilfe:
Ist es möglich das Schließkreuz einer UF zu entfernen (nicht deaktivieren, das bekomme ich hin). Ich möchte erreichen, daß das Schließkreuz in der UF garnicht mehr auftaucht.
Danke schon mal an alle.
Gruß
Dieter
Private Sub CommandButton2_Click()
frmSoKo.Show
End Sub
Option Explicit
Private Const GWL_STYLE = (-16)
Private Const WS_SYSMENU = &H80000
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 Sub UserForm_Activate()
Dim xl_hwnd, lStyle
xl_hwnd = FindWindow(vbNullString, Me.Caption)
If xl_hwnd <> 0 Then
lStyle = GetWindowLong(xl_hwnd, GWL_STYLE)
lStyle = SetWindowLong(xl_hwnd, GWL_STYLE, lStyle And Not WS_SYSMENU)
DrawMenuBar xl_hwnd
End If
End Sub