Menubar width |
Post Reply |
Author | |
ddebono
Groupie Joined: 02 August 2005 Location: Norway Status: Offline Points: 31 |
Post Options
Thanks(0)
Posted: 02 August 2005 at 5:37pm |
How to find the width that the windows has to be to fit the menubar/commandbar ? And is it possible to turn off the menubar wrapping when the windows gets to narrow? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
1. Try GetWindowRect method. 2. EnableDocking method + xtpFlagHideWrap |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ddebono
Groupie Joined: 02 August 2005 Location: Norway Status: Offline Points: 31 |
Post Options
Thanks(0)
|
Thanks,
The EnableDocking worked, but not the GetWindowRect. The reason is that if the form is narrower than a toolbar, the GetWindowRect will report the actual left and right, and not the ones needed for non-clipping of the toolbar. Maybe a GetWindowNonClipping function or something ? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
You must disable stretch flag first.
CommandBars.ActiveMenuBar.EnableDocking xtpFlagHideWrap |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ddebono
Groupie Joined: 02 August 2005 Location: Norway Status: Offline Points: 31 |
Post Options
Thanks(0)
|
Hi, Stretch flag is this the xtpFlagHideWrap ? You example does not work. It still reports a much narrower width than needed. It seems that it reports no wider than the actual form width. What I use it for is when the fontsize and icon size goes from normal to large. And then find the width necessary. Private Sub FixMenuMode() Dim fntTmp As StdFont On Error GoTo Hell Set fntTmp = Me.Font Hell: Private Function FindMenuWidth() As Long Dim lLeft As Long On Error GoTo Hell CommandBars.ActiveMenuBar.EnableDocking xtpFlagHideWrap CommandBars.RecalcLayout Exit Function Hell: Edited by ddebono |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
GetWindowRect retruns current Width... I think Toolbar already wrapped so it returns wrapped Width of toolbar.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ddebono
Groupie Joined: 02 August 2005 Location: Norway Status: Offline Points: 31 |
Post Options
Thanks(0)
|
Oleg, Yes it seems like the toolbar is already wrapped, and there no way to turn it off. But the same thing also happens with the menu bar even though wrapping is turned off. You should look more into this. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |