Results 1 to 4 of 4

Thread: Toolbar with separator height when wrapped

  1. #1

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    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?
    Attached Images Attached Images  
    Last edited by trisuglow; Dec 20th, 2004 at 06:04 AM.
    This world is not my home. I'm just passing through.

  2. #2
    Addicted Member Wolfgang Enzinger's Avatar
    Join Date
    Apr 2014
    Location
    Munich, Germany
    Posts
    160

    Re: Toolbar with separator height when wrapped

    Quote Originally Posted by trisuglow View Post
    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

  3. #3
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    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

  4. #4
    Addicted Member Wolfgang Enzinger's Avatar
    Join Date
    Apr 2014
    Location
    Munich, Germany
    Posts
    160

    Re: Toolbar with separator height when wrapped

    Quote Originally Posted by Schmidt View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width