In the UserForm module:
Private Declare Function FindWindow& Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function SetWindowLong& Lib "user32" _
Alias "SetWindowLongA" (ByVal hWnd&, ByVal nIndex& _
, ByVal wNewWord&)
' If you want to be able to move UserForm
Private Declare Function ReleaseCapture& Lib "user32" ()
Private Declare Function SendMessage& Lib "user32" _
Alias "SendMessageA" (ByVal hWnd&, ByVal wMsg& _
, ByVal wParam%, ByVal lParam As Any)
Private hWnd&
' You need a button to close UserForm
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
' Title bar is a skin -> resize UserForm dimensions
Me.Height = Me.InsideHeight + ((Me.Width - Me.InsideWidth) / 2)
Me.Width = Me.InsideWidth
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84080080 ' No caption
SetWindowLong hWnd, -20, &H40000 ' No borders
End Sub
' If you want to be able to move UserForm
Private Sub UserForm_MouseDown(ByVal Button%, ByVal Shift%, ByVal X!, ByVal
Y!)
ReleaseCapture
SendMessage hWnd, &HA1, 2, 0&
End Sub
Regards,
MP
"new_to_vba" <(E-Mail Removed)> a écrit dans le message de
news:
C4087450-F73B-4117-BD4E-(E-Mail Removed)...
> Hi Michel Pierron,
> No i do not need to keep the title bar.
>
> "Michel Pierron" wrote:
>
>> Hi new_to_vba,
>> It is not possible if you wish to preserve the title bar UserForm.
>>
>> MP
>>
>> "new_to_vba" <(E-Mail Removed)> a écrit dans le
>> message
>> de news: FE748055-DCC2-4445-86D9-(E-Mail Removed)...
>> > how do i remove the blue border around a userform. so all you see is
>> > the
>> > form
>> > itself?
>> >
>> > all help appreciated
>>
>>
>>