Position a commandbar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • adrian.chandler@Bigfoot.com

    #1

    Position a commandbar

    I have a form with a subform. The subform occupies about the bottom
    two thirds of the screen. The form has a custom CommandBar docked at
    the top. The subform also has its own CommandBar. I want to position
    the subform's CommandBar just above the subform - that is about one
    third down from the top, but I have been unable to get the effect I
    want using the code below:

    Dim cbrBar As CommandBar

    Set cbrBar = Application.Com mandBars("cbrCW rdU")

    With cbrBar
    .Visible = True
    .Position = msoBarFloating
    .Top = 220
    .Left = 10
    End With


    The problem is that with the Position property set to msoBarFloating,
    the ConmmandBar is displayed with a grey title bar of its own showing
    the name of the CommandBar and an X to close it. This is not what I
    want. You do not get this with msoBarTop, msoBarBottom, etc.

    I do not want a floating toolbar in the sense of one that can be
    dragged around the screen and repositioned. I want to fix it
    permanently in the chosen position. But as far as I can see, you have
    to specify msoBarFloating, if you do not want Top, Bottom or either of
    the two sides.





    Adrian Chandler

  • Rick Brandt

    #2
    Re: Position a commandbar

    adrian.chandler @Bigfoot.com wrote:[color=blue]
    > I have a form with a subform. The subform occupies about the bottom
    > two thirds of the screen. The form has a custom CommandBar docked at
    > the top. The subform also has its own CommandBar. I want to position
    > the subform's CommandBar just above the subform - that is about one
    > third down from the top, but I have been unable to get the effect I
    > want using the code below:
    >
    > Dim cbrBar As CommandBar
    >
    > Set cbrBar = Application.Com mandBars("cbrCW rdU")
    >
    > With cbrBar
    > .Visible = True
    > .Position = msoBarFloating
    > .Top = 220
    > .Left = 10
    > End With
    >
    >
    > The problem is that with the Position property set to msoBarFloating,
    > the ConmmandBar is displayed with a grey title bar of its own showing
    > the name of the CommandBar and an X to close it. This is not what I
    > want. You do not get this with msoBarTop, msoBarBottom, etc.
    >
    > I do not want a floating toolbar in the sense of one that can be
    > dragged around the screen and repositioned. I want to fix it
    > permanently in the chosen position. But as far as I can see, you have
    > to specify msoBarFloating, if you do not want Top, Bottom or either of
    > the two sides.[/color]

    You could simulate a toolbar directly in the design of the subform and then
    all of this is taken care of. Either by using buttons and labels or by
    using those to invoke shortcut menus.

    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com


    Comment

    • adrian.chandler@Bigfoot.com

      #3
      Re: Position a commandbar


      Rick Brandt wrote:[color=blue]
      > adrian.chandler @Bigfoot.com wrote:[color=green]
      > > I have a form with a subform. The subform occupies about the bottom
      > > two thirds of the screen. The form has a custom CommandBar docked at
      > > the top. The subform also has its own CommandBar. I want to position
      > > the subform's CommandBar just above the subform - that is about one
      > > third down from the top, but I have been unable to get the effect I
      > > want using the code below:
      > >
      > > Dim cbrBar As CommandBar
      > >
      > > Set cbrBar = Application.Com mandBars("cbrCW rdU")
      > >
      > > With cbrBar
      > > .Visible = True
      > > .Position = msoBarFloating
      > > .Top = 220
      > > .Left = 10
      > > End With
      > >
      > >
      > > The problem is that with the Position property set to msoBarFloating,
      > > the ConmmandBar is displayed with a grey title bar of its own showing
      > > the name of the CommandBar and an X to close it. This is not what I
      > > want. You do not get this with msoBarTop, msoBarBottom, etc.
      > >
      > > I do not want a floating toolbar in the sense of one that can be
      > > dragged around the screen and repositioned. I want to fix it
      > > permanently in the chosen position. But as far as I can see, you have
      > > to specify msoBarFloating, if you do not want Top, Bottom or either of
      > > the two sides.[/color]
      >
      > You could simulate a toolbar directly in the design of the subform and then
      > all of this is taken care of. Either by using buttons and labels or by
      > using those to invoke shortcut menus.
      >
      > --
      > I don't check the Email account attached
      > to this message. Send instead to...
      > RBrandt at Hunter dot com[/color]

      Comment

      • adrian.chandler@Bigfoot.com

        #4
        Re: Position a commandbar

        If you drag a floating Toolbar by its title bar so that it docks at any
        of the four edges of the screen, the thick title bar changes to a light
        gray bar at the left side made up of very short lines. Nice and
        discreet - that would do nicely.

        This bar is the handle with which you can move it around the screen.
        But as soon as you drag it out of its docked position, the thick title
        bar reappears - very annoying!

        Perhaps Stephen Labans can work his magic so that my tool bar sitting
        above a subform about half way down the screen, will look like a normal
        docked toolbar and not be twice as high?

        I have tried assigning the CommandBar to the Toolbar property of the
        subform, but it just docks at the top of the screen.

        Comment

        Working...