Toolbars docked to right


04-20-2009, 11:10 PM

Is there any way of making toolbar to be aligned to the right side of the application window? When window is resized the "right-aligned" toolbars are not following the application window as it is for example in msword.

Re: Toolbars docked to right


04-21-2009, 10:28 AM
It's simple


Private Sub Form_Resize()

Me.ActiveBar31.Left = Me.ScaleWidth - Me.ActiveBar31.Width

End Sub


HTH

Re: Toolbars docked to right


04-22-2009, 6:58 AM

Yes, I know that. But to make it work with all toolbars, the layout has to be looped and done to all toolbars with each resize callback. This is pretty heavy operation with bigger layout files. Seems to be so that activebar doesn't support this (?). This should work by default in the same way as in other ms applications...

Re: Toolbars docked to right


04-23-2009, 1:53 AM

janttu,

Maybe I missed something but vbcorner's code snippet just keeps entire ActiveBar area with all toolbars, etc. on the right side of application window. Also, I think, its more comfortable to set ActiveBar's AlignToForm property so ActiveBar fills the entire SDIForm's client area so that the control can become an adequate sized container for your controls. So you can place all other controls in a PictureBox, for example, and place PictureBox in ActiveBar client area (by using AutoSizeChildren and ClientAreaControl properties).

Thank you,
Andrey T.

Re: Toolbars docked to right


04-24-2009, 7:38 AM
<BLOCKQUOTE><table width="85%"><tr><td class="txt4"><img src="/Themes/DataDynamics/images/icon-quote.gif">&nbsp;<strong>janttu wrote:</strong></td></tr><tr><td class="quoteTable"><table width="100%"><tr><td width="100%" valign="top" class="txt4"><P>Yes, I know that. But to make it work with all toolbars, the layout has to be looped and done to all toolbars with each resize callback. This is pretty heavy operation with bigger layout files. Seems to be so that activebar doesn't support this (?). This should work by default in the same way as in other ms applications...</P></td></tr></table></td></tr></table></BLOCKQUOTE>

No. The above code work con whole AB control (if it isn't 'aligned' to form) therefore don't need anything.

If you use a 'aligned' (top or bottom) AB then should align each Band; using code like below.
This sample code align a "band" to right, by calculating the width for all buttons to apply the correct DockingOffset :
<font face="Lucida Console" size="2">
Public Sub AlignBandToRight(ByRef f As Form, ByRef tBandName As ActiveBar3LibraryCtl.Band, Optional bUseCaptionBelow As Boolean = True)
Dim L As Long
Dim btn As ActiveBar3LibraryCtl.Tool

For Each btn In tBandName.Tools
' GB 24-nov-2008 09.10 : I want to put Caption below: Default YES
If bUseCaptionBelow Then
btn.CaptionPosition = ddCPBelow
btn.Style = ddSIconText
End If
' GB lun 29-dic-2008 23.52 : calc width-button for visible buttons only.
If btn.Visible Then
L = L + btn.Width
End If
Next

With tBandName
If bUseCaptionBelow Then 'Default: YES
f.AB.Height = 720
.Height = 720
.Top = f.ScaleHeight - .Height
End If
.DockingOffset = f.ScaleWidth - L
End With

End Sub
</font>

HTH

Re: Toolbars docked to right


04-29-2009, 3:59 AM

I don't want all the toolbars to be aligned to right all the time. This is the case you're talking about, right? I want the toolbar alignment to work as in ms word; once you've repositioned the toolbar to the right side of the application window and after that resize the window (make smaller then larger) the appropriate toolbar stays right-aligned (as long as the window size isn't larger than in the situation the toolbar was right-aligned). You can test this with ms word. For this I'm looking for solution. Second of all I don't want the toolbar to use all the space from the dockline. There's no point in that solution.

Re: Toolbars docked to right


04-29-2009, 6:08 AM
I use MS Word 2007, so I cannot figure your problem.
Sorry.