Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Easy way to dock  CommandBars/Ribbonbar to top
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Easy way to dock CommandBars/Ribbonbar to top

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


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Topic: Easy way to dock CommandBars/Ribbonbar to top
    Posted: 13 April 2010 at 3:11pm
Hi.

I was hoping to change from ActiveBar (DataDynamics) to CommandBars-menus (Ribbonbar) in all our forms (>100). We are using vb6. I am trying to find an easy way. I have created an object wich creates the menus itself. We use layout-files to dynamically create the ActiveBars and I have mangaed to create an object whick create CommanBars menys (as Ribbonbars) of the same layout. And it work great. It is really good-looking. But I have a problem when I am trying to just swap the AcitveBar-component with the CommanBars component in my excisting forms. Where the ActiveBar always dock itself to the top, my CommnadBars doesnt.
We use a tab-component from ComponentOne a lot wich has an Allign-property set to Fill. When we use ActiveBar the menu dock itself to the top and the Tab-control comes under and fill the rest of the form. With CommandBars the Tab-control fill the entire form and my menu doesnt show. (it is behind).

I am tryning to find the easiest way to dock my COmmandbars-control to the top, because there are many many forms that I will implement this to if it workds. Anyone can help me?

This is my code sofar:

Set Ribbonbar = theMenu.AddRibbonBar("The Ribbon")
   
Ribbonbar.EnableDocking xtpFlagAlignTop   'xtpFlagStretched
Ribbonbar.Position = xtpBarTop


theMenu is my CommandBars-control which is on the form


Please help. Would really lift our program

We are using Xtreme SuitePro ActiveX v12.1.0 - by the way
Back to Top
gvidali View Drop Down
Newbie
Newbie
Avatar

Joined: 03 April 2009
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote gvidali Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2010 at 9:54am
I solved the same issue with few lines of code.

1 -- Set the "align" property of your tab control or elastic control to asNone (0 - zero).

2 -- In the Resize event of your commandbar, use this snippet (control c1, in this case, is an elastic control)...

If Me.WindowState <> vbMinimized Then
    CommandBars1.GetClientRect iLeft, iTop, iRight, iBottom
    c1.Move iLeft, iTop, iRight, iBottom - iTop
End If

Hope this helps...

Giorgio
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2010 at 11:30am
You can use ResizeClient-Event of the CommandBar. This works also if your form is being resized.
Back to Top
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2010 at 5:06pm
Thanks a lot. Both works. Was just hoping that there was a simple property on the control to dock it to the top (it is a toolbar-control afterall). No I have to add an elastic to each of our forms. Not that much work, but anyway.... thanks a lot
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
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.203 seconds.