ich habe eine frage und bitte euch um Hilfe.
Ich habe mehere Codes um eine Userform zu erstellen.
habe mich in dem Fall für diesen Code entschienden.
Diese erstellt mir die Userform mit den Symbolen zum Minimieren und Maximieren.
Diese möchte ich auch angezeigt bekommen nur "grau" also grau hinterlegt deaktiviert.
Nur das X zum schliesen soll sichtbar angezeigt werden.
Würde mich sehr über Ratschläge und Tipps freuen.
Vielen dank an alle gruß Chris
Hier der Code in meinem Klassenmodul:
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 ShowWindow _
Lib "user32" _
(ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Private Declare Function DrawMenuBar _
Lib "user32" _
(ByVal nWnd As Long) As Long
Private Declare Function SetFocus _
Lib "user32" _
(ByVal hwnd As Long) As Long
Private Const GWL_STYLE As Long = (-16)
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_MINIMIZEBOX As Long = &H20000
Private Const WS_MAXIMIZEBOX As Long = &H10000
Private Const WS_EX_APPWINDOW As Long = &H40000
Private Const SW_HIDE As Long = 0
Private Const SW_SHOW As Long = 5
Dim objMinMaxUF As Object
Public Property Set formular(objUF As Object)
Dim lngUFHandle As Long
Dim lngFensterStil As Long
Set objMinMaxUF = objUF
lngUFHandle = FindWindow(vbNullString, objMinMaxUF.Caption)
lngFensterStil = GetWindowLong(lngUFHandle, GWL_STYLE)
lngFensterStil = lngFensterStil Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
SetWindowLong lngUFHandle, GWL_STYLE, lngFensterStil
lngFensterStil = GetWindowLong(lngUFHandle, GWL_EXSTYLE)
lngFensterStil = lngFensterStil Or WS_EX_APPWINDOW
SetWindowLong lngUFHandle, GWL_EXSTYLE, lngFensterStil
ShowWindow lngUFHandle, SW_HIDE
DrawMenuBar lngUFHandle
ShowWindow lngUFHandle, SW_SHOW
SetFocus lngUFHandle
End Property