Print Page | Close Window

Toolbars on 1 row

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=18768
Printed Date: 23 November 2024 at 4:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbars on 1 row
Posted By: SteveStraley
Subject: Toolbars on 1 row
Date Posted: 03 August 2011 at 11:56am
Hi Everyone,

Maybe I have had enough coffee yet.   I need help figuring this out.   I have 2 instances of a TOOLBAR and I want them to appear on the same row with one another.   If I assign them both XTPBarPosition.xtpBarTop then one appears at the top most available row in the wind and the second appears right under the first...

Ideas?

Thanks,

Steve



Replies:
Posted By: Xander75
Date Posted: 04 August 2011 at 3:30am
Hi,

It can be done by using the following code:

' How to use...
' Call DockRightOf(ToolBar1,
ToolBar2)

Private Sub DockRightOf(BarOnLeft As CommandBar, BarToDock As CommandBar)
    Dim Bottom As Long, Left As Long, Right As Long, Top As Long
  
    CommandBars.RecalcLayout
    BarOnLeft.GetWindowRect Left, Top, Right, Bottom
    CommandBars.DockToolBar BarToDock, Right, (Bottom + Top) / 2, BarOnLeft.Position
End Sub



-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: SteveStraley
Date Posted: 04 August 2011 at 10:42am
Hi Xander... thanks... I did the translation to C#.
 
The trick, in case anyone tries this, is that the toolbar to be re-positioned needs to happen after the main window has been "drawn" or "shown".   For example, I did the call within the "load" of the main window with the command bars and it didn't work... when I moved the call to the method that is triggered when the main window/command bars are shown, it did work...
 
Mega thanks... if people want the converted C# code, let me know!!!!


Posted By: Xander75
Date Posted: 04 August 2011 at 10:45am
Hi Steve,

Glad the code helped even though you required to convert this to C#. You might be best to add the code to this post, especially as in the near future I might be using the Codejock Suite in C#. So I will need all the help I can get! LOL


-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net