wie kann ich in einer Userform die blaue "Caption-Leiste" und den "Exit-Button" entfernen, das diese beim Aufruf nicht mit erscheinen?
M.f.G.
Lutz
Option Explicit
Private Declare Function CreateRoundRectRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, _
ByVal X2 As Long, ByVal Y2 As Long, _
ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" _
(ByVal hWnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub UserForm_Initialize()
Me.Width = 350: Me.Height = 350
Commandbutton1.Left = (Me.Width - Commandbutton1.Width) / 3
Commandbutton1.Top = Me.Height * 0.6
End Sub
Private Sub UserForm_Activate()
Dim x As Long, y As Long, n As Long, mWnd As Long
x = Me.Width
y = Me.Height
n = 4
mWnd = FindWindow(vbNullString, Me.Name)
SetWindowRgn mWnd, CreateRoundRectRgn(2, 2, x, y, n, n), True
End Sub
Gruß Jens