Ribbon in Excel 2007: positioning buttons using box controls

I'm trying to position 5 buttons in a group:
2 vertically on the left, 2 vertically on the right, and one below.

The code below places the last button on the far right and I'm
wondering what I can do to fix this.  I realise that I can set the
boxStyle to horizontal and rearrange the buttons, but I'm trying to
keep them grouped in a logical fashion as above.  If all else fails, I
will revert to this, but I would have thought there'd be a solution.
Any suggestions appreciated.

Thanks in advance

Paul Martin
Melbourne, Australia
0
Paul
12/21/2009 4:42:47 AM
excel.programming 6508 articles. 1 followers. Follow

6 Replies
968 Views

Similar Articles

[PageSpeed] 40

I forgot to post my code:

<group id="Import" label="Import">

   <box boxStyle="vertical" id="box1">
	<button id="buttonL1" label="Left Top" onAction="DoSomething"/>
	<button id="buttonL2" label="Left Middle" onAction="DoSomething"/>
   </box>

   <box boxStyle="vertical" id="box2" >
	<button id="buttonR1" label="Right Top" onAction="DoSomethingy"/>
	<button id="buttonR2" label="Right Middle" onAction="DoSomething"/>
   </box>

	<button id="buttonB" label="Bottom" onAction="DoSomething"/>

</group >
0
Paul
12/21/2009 4:50:30 AM
Hi,

This forces the middle button to the third row. Remove label items if you 
want to raise the middle button.

<!--RibbonX Visual Designer 1.7 for Microsoft Excel. XML Code produced on 
2009/12/21-->
<customUI  xmlns="http://schemas.microsoft.com/office/2006/01/customui" >
 <ribbon >
  <tabs >
   <tab  idMso="TabHome" >
    <group
     id="Group1"
     label="Group1">
     <box
      boxStyle="vertical"
      id="Box1">
      <button
       id="Button1"
       label="Top Left"/>
      <button
       id="Button2"
       label="Bottom Left"/>
      <box
       boxStyle="vertical"
       id="Box2">
       <labelControl
        id="Labelcontrol1"
        label="Labelcontrol1"
        showLabel="false"/>
       <labelControl
        id="Labelcontrol2"
        label="Labelcontrol2"
        showLabel="false"/>
       <button
        id="Button3"
        label="Middle"/>
      </box >
      <box
       boxStyle="vertical"
       id="Box3">
       <button
        id="Button4"
        label="Top Right"/>
       <button
        id="Button5"
        label="Bottom Right"/>
      </box >
     </box >
    </group >
   </tab >
  </tabs >
 </ribbon >
</customUI >

Cheers
Andy
-- 

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Paul Martin" <melbournefilm@gmail.com> wrote in message 
news:695fa620-6f06-48b9-8707-39d6c645b03d@j24g2000yqa.googlegroups.com...
> I'm trying to position 5 buttons in a group:
> 2 vertically on the left, 2 vertically on the right, and one below.
>
> The code below places the last button on the far right and I'm
> wondering what I can do to fix this.  I realise that I can set the
> boxStyle to horizontal and rearrange the buttons, but I'm trying to
> keep them grouped in a logical fashion as above.  If all else fails, I
> will revert to this, but I would have thought there'd be a solution.
> Any suggestions appreciated.
>
> Thanks in advance
>
> Paul Martin
> Melbourne, Australia 

0
Andy
12/21/2009 1:37:14 PM
Thanks Andy, but that doesn't quite solve the problem.  Or, it solves
one but creates another, because it spreads the width of the group by
inserted a middle column.  Effectively, that XML creates 3 columns,
each 3 rows.  What I want is 2 columns that are each 2 rows, with a
single row (but 2 columns wide) underneath in the third row.

You did get me thinking about boxes and I thought the code below would
solve the problem, but it doesn't.  It still places the final button
into a third column.  What this code attempts is to put the two
vertical boxes into a horizontal box, with a button below that (and
putting the button into a box does nothing, as you'd expect).

Any other suggestions?

Paul

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui">
<ribbon>
<tabs>
<tab idMso="TabHome">
<group id="grp1" label="Test">

  <box boxStyle="vertical" id="box1">
    <box id="box2">
      <box boxStyle="vertical" id="box3">
        <button id="btn1" label="Top L"/>
        <button id="btn2" label="Mid L"/>
      </box>

      <box boxStyle="vertical" id="box4">
        <button id="btn3" label="Top R"/>
        <button id="btn4" label="Mid R"/>
      </box>
    </box>

    <button id="btn5" label="Bottom"/>
  </box>

</group>
</tab>
</tabs>
</ribbon>
</customUI>
0
Paul
12/23/2009 12:08:15 AM
As an aside, I've been playing around with Button Groups and Buttons.
Inserting 3 Button Groups "sort of" addresses the problem by placing
the buttons in roughly the configuration I'm after.  But there's two
drawbacks:
1). The RHS buttons on the top and middle rows are not left justified.
2). The buttons appear with the button image.

1) could be fixed by buffering the LHS with spaces.  Not ideal, but it
would do the trick.
2) doesn't seem to have any workaround.

All-in-all, this is not an adequate solution, so... I'm still looking.
0
Paul
12/23/2009 12:40:04 AM
Try this, still a work around.

3 horizontal boxes within a vertical box.
Rather than padding the buttons with leading spaces I used a label control 
to pad the area between the buttons for the top and middle section.
For the Bottom section the labels pad around the button to center it.

<!--RibbonX Visual Designer 1.7 for Microsoft Excel. XML Code produced on 
2009/12/23-->
<customUI  xmlns="http://schemas.microsoft.com/office/2006/01/customui" >
 <ribbon >
  <tabs >
   <tab
    id="Tab1"
    label="Tab1">
    <group
     id="Group1"
     label="Group1">
     <box
      boxStyle="vertical"
      id="Box1a">
      <box
       boxStyle="horizontal"
       id="Box2a">
       <button
        id="Button1"
        label="Top Left"/>
       <labelControl
        id="Labelcontrol1"
        label="       "/>
       <button
        id="Button2"
        label="Top Right"/>
      </box >
      <box
       boxStyle="horizontal"
       id="Box3a">
       <button
        id="Button3"
        label="Middle Left"/>
       <labelControl
        id="Labelcontrol2"
        label=" "/>
       <button
        id="Button4"
        label="Middle Right"/>
      </box >
      <box
       boxStyle="horizontal"
       id="Box4a">
       <labelControl
        id="Labelcontrol3"
        label="  "/>
       <button
        id="Button5"
        label="Button Across Bottom "/>
       <labelControl
        id="Labelcontrol4"
        label="  "/>
      </box >
     </box >
    </group >
   </tab >
  </tabs >
 </ribbon >
</customUI >

Cheers
Andy

-- 

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Paul Martin" <melbournefilm@gmail.com> wrote in message 
news:54b2aa43-f046-49ec-894e-213900f112c4@21g2000yqj.googlegroups.com...
> As an aside, I've been playing around with Button Groups and Buttons.
> Inserting 3 Button Groups "sort of" addresses the problem by placing
> the buttons in roughly the configuration I'm after.  But there's two
> drawbacks:
> 1). The RHS buttons on the top and middle rows are not left justified.
> 2). The buttons appear with the button image.
>
> 1) could be fixed by buffering the LHS with spaces.  Not ideal, but it
> would do the trick.
> 2) doesn't seem to have any workaround.
>
> All-in-all, this is not an adequate solution, so... I'm still looking. 

0
Andy
12/23/2009 9:03:02 AM
Thanks, Andy (and happy new year - I just got back from my holidays).
I think your suggestion might suit some who come looking for a similar
solution, but it's a bit messy for me because:
1). The padding can emulate left justification for the RHS buttons but
is fiddly
2). I wanted to group certain buttons together, which this doesn't do.

In the end, it's easier just to add the buttons without any boxes so
that the first two are vertically adjacent, the bottom button is below
that and then the next two buttons are automatically in the next
column, also vertically adjacent.  It seems a pity that there's not
better control over the placement of the buttons.

Thanks again

Paul
0
Paul
1/3/2010 11:31:18 PM
Reply:

Similar Artilces:

Using Hyperlinks for Navigation
My OS is Windows XP Pro and my Applicaton is Word 2007. I developed a reference document which is long but uses hyperlinks to navigate beweeen files. Unfortunately I don't understant some basic features of hyperlinks. I've stored the reference on my hard drive (C:) and burn it to CD. But I've noticed the definition of the hyperlinkks change. I may have it pointing to the same folder to a specific file {HYPERLINK "Tools.docx"} and find it pointing to {HYPERLINK "file:///c:\\Documents20%and20%Settings . . . . . .} I don't understand why or how th...

how can i factorise numbers on excel?
how can i factorise numbers on excel e.g. get all the factors of the number i input? Sam, Do you want the prime factors? 12 => 2,2,3 or all possible factors? 12=> 1,2,3,4,6,12 HTH, Bernie MS Excel MVP "Sam" <Sam@discussions.microsoft.com> wrote in message news:7D93182E-8953-4F1A-B02C-F29A6615E3CC@microsoft.com... > how can i factorise numbers on excel e.g. get all the factors of the number i > input? "Sam" <Sam@discussions.microsoft.com> wrote in message news:7D93182E-8953-4F1A-B02C-F29A6615E3CC@microsoft.com... > how can i factorise...

auto fill last used date
I have a form that requires entering the same date multiple times (not necessarily todays date) how can I have it autofill the date that I enter the first time? Here is a link that explains it. I would put the code in the After Update event of the control for the date: http://www.mvps.org/access/forms/frm0012.htm -- Dave Hargis, Microsoft Access MVP "Gary" wrote: > I have a form that requires entering the same date multiple times (not > necessarily todays date) how can I have it autofill the date that I enter the > first time? ...

Forms Results in Excel
Does anyone have an idea how I can get the results for a form in FrontPage to be put into Excel? med211 I don't have FP installed right now I seem to remember you could export to Excel. I would suggest first looking in FP help on exporting to other applications. Gord Dibben MS Excel MVP On Tue, 2 Feb 2010 22:39:40 -0600, "med211" <jkerry@charter.net> wrote: >Does anyone have an idea how I can get the results for a form in FrontPage >to be put into Excel? > >med211 > ...

Merging in Excel
Hi, I have a list with employees in Excel. We have also got an Order Form in Excel. Is there a way to merge this list into the Order form in a way so I can get one form per employee to print? Regards Jenny Jenny, Nope. Not directly. Excel pretty much prints the way the sheet is laid out, with a few exceptions. A mail merge in Word would suit your needs. It can dynamically use your Excel list. Or and Access report (printout). It can also dynamically use your Excel list. -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "J...

MFC and Excel
Hi, I have an excel web query which refreshes data every x minutes to a worksheet. I would like to "integrate" it will existing MFC code so that the data is visible to the MFC program 'real-time'. Whats the best/simplest way to do this? I have found this MS reference on automation. Is this the way to go? Or should I be looking at OLE or DDE? I know next to nothing about this subject area. Thanks for any ideas, examples and/or references. >I have found this MS reference on automation. Is this the way to go? >Or should I be looking at OLE or DDE? Using OLE auto...

2007 Ribbon Bar
Is there any way to hide or customize the 2007 ribbon bar to the same size as any older version of an access menubar? The size of the new ribbon bar forces my form to get cut off on the bottom of the screen. This has been getting many bad reviews from my users and either I need to redesign my form or find a way to get rid of the ribbon bar. I opt to go the easier route (if at all possible) of hiding the ribbon bar. On Tue, 23 Oct 2007 17:44:01 -0700, Secret Squirrel <secretsquirrel@discussions.microsoft.com> wrote: Right click in the area where the tabs are, and choose "Minim...

converting numbers in excel to access
using jdbcodbc i am picking data from excel and inserting them into a access table. the problem area in this is the numbers that have decima data e.g. 23.345 . in access i get only the 23 and not the portion after the decimal . have tried with getInt as well as getStrin -- sonik ----------------------------------------------------------------------- sonika's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1497 View this thread: http://www.excelforum.com/showthread.php?threadid=26751 ...

When using general format for a cell, numbers appear with decimals
I'm working in a new workbook. When I type in a number like 535, it shows up in the cell as 5.35 The format of the cell is General and not number. Even the example that shows up when looking at the cell format shows the decimal. This shouldn't be happening. Any suggestions? I may have found it. The tools/options/Edit tab Fixed decimal checkbox..... "Simmian" wrote: > I'm working in a new workbook. > > When I type in a number like 535, it shows up in the cell as 5.35 > > The format of the cell is General and not number. Even the example that...

auto numbering excell form
can anyone tell me how to auto populate a form I have created in excell I want the number to go up 1 everytime the form is opened????????? Take a look here: http://www.mcgimpsey.com/excel/sequentialnums.html In article <213B0381-BF0D-4287-95C7-6E1953A09330@microsoft.com>, Len <Len@discussions.microsoft.com> wrote: > can anyone tell me how to auto populate a form I have created in excell > I want the > number to go up 1 everytime the form is opened????????? ...

Excel Chart Help
Hello Everyone, I've been tasked with updating a 14 year old excel macro running on a 15 year old mac :(. I'm running into problems with the replicating the charts. Heres an example: http://img99.imageshack.us/my.php?image=0103080255gp2.jpg (Sorry about the quality, camera phone...) Each group represents a different area of our state and each group has its own average line. I'm having 2 problems. Grouping the data from each area together. When I try to set each area up as a series it groups the first entry of each area together then the second entry for each area and so on. ...

Multiple Variables in an Excel Formula & SUMIF
Here's my problem(s) I have 5 columns. Column A is information I enter. (The information will be numbers 1-8). In column B, I want a formula that will examine information entered in column A and based upon that number, will display one of 8 different variables col A: col B "1" "15500 "2" "17700 "3" "19950" & so forth. Column C is information I enter. In Column D, I have a formula: =IF(B9<=C9, "50% or below","OVER 50%"). My next problem: I n...

Categories in Outlook 2007
Does anyone know if it is possible to see ALL of your items categorised by colour in one place? You can see tasks and appointments in the To-Do Bar, but the appointments are listed together and then the tasks are listed together. I have been asked if you can group all items categorised by colour together in one place, eg appointments, tasks, mail items and contacts. Sounds a bit over the top, but I've beend asked the question, have spent ages looking through help files and web pages, but haven't found what I'm looking for. If anyone has any ideas they would be ve...

How do I convert a word table into an excel document?
I have managed to get the info accross no problem but the formatting is all over the place. For instance - 07/10 meaning July 2010 is appearing as 07/Oct despite me going into format cells custom then enter mm/yy which has always worked previously. Any ideas? You can't use it like that regardless of formatting, you need to put in the whole date or else Excel will always assume the current year so any real date used for calculations needs to be numeric and needs a day, so you can enter (assuming US date format) 07/01/10 and use a custom format of mm/yy or if you don't need it for...

Cannot open multiple excel files by clicking on new files
I cannot open multiple excel files by double-clicking on another excel file when i've already got one excel file open. The only way I can do that is to open a file within excel. This is ridiculously frustrating especially when I don't know exactly where the file is and need to look in various folders to find it. Once I've found it, I can't simply click on it, but need to go back to excel and open it from within excel. Excel 2000 never had this problem. It must be an XP thing. Please advise! ...

2007
Hi! - I was hoping someone could help me please. Here's what I have. A worksheet that has several dates in a row. D1:T1, Of that range, I have conditional formatting set to highlight a date(s) either = to or within the next 7 days. I need to be able to pull the date next closest or equal to today. Can anyone help me out? Any help would be greatly appriecated. Shaun > I was hoping someone could help me please. Here's what I have. A > worksheet that has several dates in a row. D1:T1, Of that range, I > have conditional formatting set to highlight a date(s) either = to or...

Convert PPT(other than MS office 2007) to XML in C# .NET Framework
In my web application I am required to do 4 tasks:- 1. Splitting MS Powerpoint's PPT to Slides. 2. Convert a MS Powerpoint's ppt Slides to the XML file. 3. Convert a MS Powerpoint's ppt Slides to the JPEG file. 4. Convert back XML to Slides. How to do programmatically in C# - VS2005 USING ONLY .NET FRAMEWORK 2.0. Help by providing code samples. ...

How to covert picture excel format to editable excel format
-- Regards JAM One way would be to scan it with OCR software...... Vaya con Dios, Chuck, CABGx3 "SANJUZ" <SANJUZ@discussions.microsoft.com> wrote in message news:D448488C-0E38-4D32-8EB3-307967D7F903@microsoft.com... > > -- > Regards > JAM ...

How many data points can you have in an Excel for a Scatter Chart.
I have a customer that has indicated that he can only plot 400 data bites in an Excel Scatter Chart. Is the correct for Excel 2002 or 2003? What does a "data bite" represent? What error message do you get? You should check the XL help topic 'Excel specifications and limits' specifically the 'Charting specifications' section. One undocumented limit is that the length of any token in the SERIES formula cannot exceed be more than about 250 characters. So, if one selects lots of non-contiguous ranges, it is very possible to exceed that limit. -- Regards, Tus...

Excel FIND Command
When I use the "find" command in Excel, the "found" cell or cells are barely a shade different in color from the spreadsheet. It is almost impossible to "see" the "found" cell. Is there a solution for this ? I don't think it was this hard before Excel 2007. Karen; this is a know issue in Excel 2007 and Excel do not have a setting to change this. One workaround is to add a background from menu Page Layout>Background; but again you will have to add for this to all sheets. -- Jacob "KarenH" wrote: > When I u...

Custom EXCEL chart value axis BRAIN TEASER
I need to format my VALUE AXIS with postive numbers above and below the zero value on the axis: 8,000 6,000 4,000 2,000 0 400 800 1,200 1,600 I know it can be done as I am looking at an existing COLUMN chart in EXCEL 2002. The chart has both primary and secondary Value axes. One series is attached to the primary value axis and one series attached to the Secondary Value axis. The primary Value Axis has a custom number format that hides all the negative values. The secondary Value Axis has a custom number format that hides all the negative values and the zero value. This ax...

Excel 2000
Can anyone help me out with this one, I tried to open two spreadsheet in two different windows but it kept showing two file within the same windows of Excel. Is there a setting within Excel or Windows for this. Thanks in advance. -- --------------------------------------------------------------------- "Are you still wasting your time with spam?... There is a solution!" Protected by GIANT Company's Spam Inspector The most powerful anti-spam software available. http://mail.spaminspector.com Tools>options>view and check windows in taskbar -- Regards, Peo Sjoblom...

Shared Workbook is "in use by another user"
I created a shared workbook and today I am unable to open it as it is "in use by another user" and it is "locked for editing." This shouldn't happen if it's shared, should it? I can open it as read-only, but that defeats the purpose of having a shared document. What might make this happen and how can I fix it? (The workbook is a basic scheduling tool for staff to type when they leave the office, why, and when they will be back. I anticipate that most of the folks will open the file, enter their data, save, and close. Two-four of use might keep it op...

Name of good books for programming in Excel #2
Could anyone help me by providing some name of good books wherefrom I could learn good programming in Excel. Name of the books, Author name and Publication Name is required. Regards, RPR ...

RIBBON COLOR
Is there any idea how to change the color of a custom tab different from default theme as in the case of Contextual tabs? Sure would oblige if appropriate XML tags, ideas or address of a source on net is provided. -- Thanx in advance, Best Regards, Faraz I don't think you can Faraz, you have a few ribbon theme colours, but all tabs carry that colour AFAICS. HTH Bob "Faraz A. Qureshi" <FarazAQureshi@discussions.microsoft.com> wrote in message news:67C1065B-1AEA-44B8-B595-210CA78EE546@microsoft.com... > Is there any idea how to change the color ...