Print Page | Close Window

Easy way to dock CommandBars/Ribbonbar to top

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=16584
Printed Date: 06 October 2024 at 10:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Easy way to dock CommandBars/Ribbonbar to top
Posted By: CapoPezzio
Subject: Easy way to dock CommandBars/Ribbonbar to top
Date 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



Replies:
Posted By: gvidali
Date 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


Posted By: Baldur
Date Posted: 14 April 2010 at 11:30am
You can use ResizeClient-Event of the CommandBar. This works also if your form is being resized.


Posted By: CapoPezzio
Date 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



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