Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Toolbars on 1 row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbars on 1 row

 Post Reply Post Reply
Author
Message
SteveStraley View Drop Down
Groupie
Groupie


Joined: 25 November 2005
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote SteveStraley Quote  Post ReplyReply Direct Link To This Post Topic: Toolbars on 1 row
    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
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (1) Thanks(1)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
SteveStraley View Drop Down
Groupie
Groupie


Joined: 25 November 2005
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote SteveStraley Quote  Post ReplyReply Direct Link To This Post 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!!!!
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.