By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,571 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,571 IT Pros & Developers. It's quick & easy.

Position a commandbar

P: n/a
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.CommandBars("cbrCWrdU")

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

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ad*************@Bigfoot.com wrote:
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.CommandBars("cbrCWrdU")

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.


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
Nov 13 '05 #2

P: n/a

Rick Brandt wrote:
ad*************@Bigfoot.com wrote:
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.CommandBars("cbrCWrdU")

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.


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


Nov 13 '05 #3

P: n/a
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.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.