+ Reply to Thread
Results 1 to 5 of 5

Command Bars

  1. #1
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Command Bars

    I have this code below which creates a CommandBar but my problem is that I thought the line of Code .Width 100 would make the width of the actual CommandBar increase if I adjusted that number, but this doesnt seem to be the case. The title in only shows Nursing Sta instead of Nursing Staff Rota.

    How can I make the CommandBar wider than is?

    Please Login or Register  to view this content.
    Last edited by JezLisle; 04-17-2009 at 06:35 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,440

    Re: Command Bars

    You can not specify the width for a toolbar. It is as wide and tall as the controls it contains.
    Notice that once it is built the cursor will change as you hover near the edges but you can not stretch the toolbar beyond the space required for the controls.

    You need to add some blank controls to pad the toolbar or shorten the title

    The toolbar is actual has a width of 116 so the code adds non working buttons till it is wide enough.
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Command Bars

    Excellent thanks for that :D

    I have noticed that it widens if I have the first Caption with a long caption.

    Do you know where I can find out about different types of CommandBars I can look at having?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,440

    Re: Command Bars

    As I said the commandbar autosizes to fit controls. So yes longer text on the buttons caption will stretch the commandbar.

    Lots of info and links here.
    http://www.mvps.org/dmcritchie/excel/toolbars.htm
    http://www.bettersolutions.com/excel...N314927331.htm

  5. #5
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Command Bars

    Excellent thanks for that :D

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1