473,412 Members | 3,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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.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
3 4353
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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric | last post by:
I have the following function which creates buttons on Excel commandbar. The problem i can't get the buttons to hook up to events. For example, if i create four buttons only the fourth one fires...
8
by: Jaime Rios | last post by:
Hi, I created a COM AddIn for Word that performs the functions that it needs to, but I needed to add the ability for the toolbar created by the COM AddIn to remember it's last position and...
0
by: ibsuzanne | last post by:
hello there, I am having a really diffuclt time positioning the toolbars where I want them in Access 2000. I have a main toolbar open and docked at the top, and I want to open an additional...
2
by: Samuel | last post by:
Hi I want to customize our IDE. I developed some Add-ins and would like to create command bar to access them directly. I'm not sure if the term of "command bar" is appropriat. I mean with it a...
0
by: anonymous | last post by:
Hello, I have a small problem with a VBA commandbar I'm using in Word 2003. I created the toolbar -which works fine - and added some controls like : TBar.Controls.Add(Type:=msoControlEdit) ...
1
by: robert.waters | last post by:
Is there any way to identify a record based on where the user's cursor is located, if the cursor is located somewhere in a query or table window? I would like to have a commandbar button call a...
2
by: agbee1 | last post by:
Hello: I've finally made the effort to ween myself from overly using tables and use CSS for my positioning. However, I am having a problem with my navigational menu properly aligning in Firefox,...
1
by: Keith L | last post by:
Hi, I am aware on how to retrieve the commandbars collection from the current db (see example), but does anyone know how to do this from a remote Access db? I tried a few variations, namely using...
1
by: spynx | last post by:
import javax.swing.JOptionPane; import java.io.*; import java.util.Arrays; public class election5 { public static void main( String args ) {
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.