Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I need to hide the UserForm Title Bar, I know how to disable the Close button; but for a special project I want to display UserFormswithout any options or a title. If anyone knows a way to do this let me know; your assistance would be greatly appreciated. Yours sincerely, Brent McIntyre *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the userform code put this at the top of the module ......
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 In the form intialize event call the function......... Private Sub UserForm_Initialize() HideCaptionBar End Sub Add the following function which is called from the intialize event .................. Private Function HideCaptionBar() Dim lngHnd As Long Dim lngStyle As Long Dim lngH(1) As Long Const GWL_STYLE = (-16) Const WS_CAPTION = &HC00000 lngH(0) = Me.Height - Me.InsideHeight If Val(Application.Version) 8 Then lngHnd = FindWindow("ThunderDFrame", Me.Caption) Else lngHnd = FindWindow("ThunderXFrame", Me.Caption) End If lngStyle = GetWindowLong(lngHnd, GWL_STYLE) And Not WS_CAPTION SetWindowLong lngHnd, GWL_STYLE, lngStyle DrawMenuBar lngHnd lngH(1) = Me.Height - Me.InsideHeight Me.Height = Me.Height + lngH(1) - lngH(0) End Function -- Cheers Nigel "Brent McIntyre" wrote in message ... Hi all, I need to hide the UserForm Title Bar, I know how to disable the Close button; but for a special project I want to display UserFormswithout any options or a title. If anyone knows a way to do this let me know; your assistance would be greatly appreciated. Yours sincerely, Brent McIntyre *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nigel,
Thanks for your assistance it worked perfectly ! Yours sincerely, Brent McIntyre *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Named range=Column title,comumn title in cellB6 use B6in equation | Excel Discussion (Misc queries) | |||
Show full path title in title bar? | New Users to Excel | |||
Pasting Objects into Chart title and Axis title | Charts and Charting in Excel | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming |