Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Caption
Hi all,
How can I hede the userform caption bar? so the user form will be without a title/caption bar. TIA Soniya |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Caption
Whops, I misunderstood what do you want, sorry!
------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Caption
it's a bit more complicated then you may have assumed
as it cannot be done without some API functions. Note1: you MUST have a button on the form to close it! Note2: The Private Declare lines MUST go at the top of a userform's 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 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 Private Sub CommandButton1_Click() Unload Me End Sub Private Sub UserForm_Initialize() HideCaptionBar End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Soniya" wrote: Hi all, How can I hede the userform caption bar? so the user form will be without a title/caption bar. TIA Soniya |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Load caption box on userform open | Excel Worksheet Functions | |||
Defining UserForm Caption from a Variable | Excel Worksheet Functions | |||
Caption Property | Excel Discussion (Misc queries) | |||
picture in caption?? | Excel Discussion (Misc queries) | |||
Label Caption Just Wont Work on UserForm | Excel Programming |