hide userform title bar and show multipage title bar in front of userform

leap out

Active Member
Joined
Dec 4, 2020
Messages
271
Office Version
  1. 2016
  2. 2010
HI

is it possible hide userform title bar and show multi page title bar in front of userform?

I have many userforms and I have one userform contains multipage . what I wan when run any userform should hide userform title bar but keep the userform run and the same time should run the useform contains multipage but just the show multi page title bar in front of userform without show the form contains multipage .

this mean just I need the title bar multipage(page1,2,3...) should show without show contains each page . each page's name is the same thing when run any userform . it show as no multiple uerform just one userform contain multiple page . it shows multiple forms inside form contains multiple pages.
like I have one userform contain multiple pages without the user note that.
thanks
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi There... Try the below:

Paste code below into a seperate module...

VBA Code:
Option Explicit

#If VBA7 Then
    Public Declare PtrSafe Function FindWindow Lib "user32" _
                Alias "FindWindowA" _
               (ByVal lpClassName As String, _
                ByVal lpWindowName As String) As Long


    Public Declare PtrSafe Function GetWindowLong Lib "user32" _
                Alias "GetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long) As Long


    Public Declare PtrSafe Function SetWindowLong Lib "user32" _
                Alias "SetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long, _
                ByVal dwNewLong As Long) As Long


    Public Declare PtrSafe Function DrawMenuBar Lib "user32" _
               (ByVal hWnd As Long) As Long
#Else
    Public Declare Function FindWindow Lib "user32" _
                Alias "FindWindowA" _
               (ByVal lpClassName As String, _
                ByVal lpWindowName As String) As Long


    Public Declare Function GetWindowLong Lib "user32" _
                Alias "GetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long) As Long


    Public Declare Function SetWindowLong Lib "user32" _
                Alias "SetWindowLongA" _
               (ByVal hWnd As Long, _
                ByVal nIndex As Long, _
                ByVal dwNewLong As Long) As Long


    Public Declare Function DrawMenuBar Lib "user32" _
               (ByVal hWnd As Long) As Long
#End If

Sub HideBar(frm As Object)

Dim Style As Long, Menu As Long, hWndForm As Long
hWndForm = FindWindow("ThunderDFrame", frm.Caption)
Style = GetWindowLong(hWndForm, &HFFF0)
Style = Style And Not &HC00000
SetWindowLong hWndForm, &HFFF0, Style
DrawMenuBar hWndForm

End Sub

And this is your Userform Initialize Code

VBA Code:
Private Sub UserForm_Initialize()
    HideBar Me
End Sub

I use this in one of my projects...
 
Upvote 0
Hi
sorry about delaying for you. actually gives error .
can you guide me by steps how works ?
is the whole code in userform module ?
 
Upvote 0
Hi
sorry about delaying for you. actually gives error .
can you guide me by steps how works ?
is the whole code in userform module ?
Hi there...

No...

The code above needs to go to a separate module...

Screenshot 2022-08-30 104053.png


Then Paste the code into the module after it has been created... will look like below...

Screenshot 2022-08-30 104210.png


Then the other smaller 2nd code goes into the Userform Module...

Screenshot 2022-08-30 104309.png
 
Upvote 0
thanks now I see that, but unfortunately you don't seem to understand me. I don't want to hide bar for form multipage . should hide bar the second form just put the second form inside multipge form . should show as in one form by autofit the second form inside multipage .
 
Upvote 0
Ok so if I understand you correctly you have:

1. Userform1
2. Multipage1
3. Userform2

You want to put Multipage1 onto Userform1 but not hide the title bar for Userform1...
Then you want to put Userform2 inside Multipage1 but hide the title bar for Userform2? Is that correct?
 
Upvote 0
I do not think it is possible to insert a userform into a multipage... Userform are always separate and inserted as such... If someone else has achieved this then can let know but yes... not possible...

What are you trying to achieve?
 
Upvote 0
I do not think it is possible to insert a userform into a multipage... Userform are always separate and inserted as such... If someone else has achieved this then can let know but yes... not possible...
I hope so somebody at least tell us if it's possible.
 
Upvote 0
I do not think it is possible to insert a userform into a multipage.
Jimmypop is absolutely right - it's not possible. Userforms cannot be placed within a Userform control on another Userform. But more importantly, I don't see that it would ever be necessary to do that. Multipages are interesting controls, because each page effectively works as a fresh 'userform' with its own controls, etc. Alternatively, you could try using frames - those work in the same way, and you can use them to effectively 'switch' between different sets of controls.
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top