1 Attachment(s)
Toolbar with separator height when wrapped
My toolbar's wrappable property is set to true, so when the MDI parent form it is on resizes the toolbar wraps to show all the buttons. The problem is that if one or more of the buttons is a tbrSeparator button the toolbar's height is too large (there is an extra bit added to the bottom).
Any one got any idea why and how I can fix it?
Re: Toolbar with separator height when wrapped
Quote:
Originally Posted by
trisuglow
My toolbar's wrappable property is set to true, so when the MDI parent form it is on resizes the toolbar wraps to show all the buttons. The problem is that if one or more of the buttons is a tbrSeparator button the toolbar's height is too large (there is an extra bit added to the bottom).
Any one got any idea why and how I can fix it?
I know this post is ten years old, but I just came across it because I have the very same problem now. I wonder if a solution has popped up in the meantime? Couldn't find any so far ...
Wolfgang
Re: Toolbar with separator height when wrapped
A simple way to suppress the effect (without searching for a real Fix in a different version of
a maybe API-created CommmonControls-ToolBar) would be an additional hosting Container
around the Toolbar and an adaption in the Form-Resize-Event.
Below I've choosen a PictureBox with the Toolbar placed within as a Child-Control:
Code:
Private Sub Form_Resize()
Dim Factor As Long
Toolbar1.Move 0, 0, ScaleWidth
Select Case Toolbar1.Height
Case Is > 3 * Toolbar1.ButtonHeight * 1.1: Factor = 3
Case Is > 2 * Toolbar1.ButtonHeight * 1.1: Factor = 2
Case Else: Factor = 1
End Select
Picture1.Move 0, 0, ScaleWidth, Factor * Toolbar1.ButtonHeight * 1.1
End Sub
Olaf
Re: Toolbar with separator height when wrapped
Quote:
Originally Posted by
Schmidt
A simple way to suppress the effect (without searching for a real Fix in a different version of
a maybe API-created CommmonControls-ToolBar) would be an additional hosting Container
around the Toolbar and an adaption in the Form-Resize-Event.
Excellent idea ... thanks! :)
Wolfgang