2

「テキスト入力」ボタンなどの動作を再現するリボン ボタンを Microsoft Office で作成したいと考えています。左 (赤) がデフォルト/最後のアクションを実行し、右 (青) が追加機能を提供する 2 つの領域に分割されます。

テキストフィル

私が得た最も近いものは、splitButtonabuttonとa を使用することでしたmenu。ただし、ここでは、デフォルト アクション用のテキストを含む大きなボタンと、ドロップダウン メニューにアクセスするための三角形を含む小さな領域のみを取得します。リボン コードと結果のボタンは次のとおりです。

<splitButton id="SplitButton1" size="normal" >
  <button id="MenuButton1" imageMso="TextFillColorPicker" label="Text Fill" />
  <menu id="Menu1" label="Label1" itemSize="normal" showLabel="true">
    <button id="MenuButton2" label="Label2" />
  </menu>
</splitButton>

ここに画像の説明を入力

使いやすさの理由から、画像に示されているとおりにドロップダウン部分に (視覚的な) 焦点を当てたいと思います。それを行う方法はありますか?

4

4 に答える 4

0

カスタマイズの制限により、やりたいことができないと思います...しかし、splitButtonの代わりにボックスを定義してみることができます。

<box id="BoxSplit" boxStyle="horizontal">
  <button id="MenuButton1" imageMso="TextFillColorPicker" />
  <menu id="Menu1" label="Text Fill" itemSize="normal" showLabel="true">
    <button id="MenuButton2" label="Label2" />
  </menu>
</box>

これにより、次の結果が得られます。

ボタンとメニューのあるボックス、ホバリングボタン

ボタンとメニューのあるボックス、ホバリングボタン

ご覧のとおり、問題はメニューとボタンが一緒に強調表示されていないことです。これがあなたに受け入れられることを願っています...

于 2012-11-19T09:12:28.563 に答える
0

I think there's only 2 options for ControlSize proeprty, either Regular or Large. So just use the Regular size, and add an image to your split button.

Please refer to this API for more details:
http://msdn.microsoft.com/en-us/library/microsoft.office.tools.ribbon.ribbonsplitbutton.controlsize

An example for Custom UI with Ribbon XML

<splitButton id="splitButton"> 
     <button id="splitButton__btn" imageMso="AlignLeft" label="SplitButton" onAction="splitButton_Click" /> 
     <menu id="splitButton__mnu"> 
     <button id="btnAlignLeft" imageMso="AlignLeft" onAction="btnAlign_Click" label="Left" /> 
      </menu> 
</splitButton> 

Ribbon XML on MSDN
http://msdn.microsoft.com/en-us/library/aa942866.aspx
http://msdn.microsoft.com/en-us/library/gg327872

Perhaps you might want to try <MenuSection> tag

<MenuSection
 DisplayMode=["Default" | "Small" | "Medium"  | "Large"  | "Text"  | "Menu"  | "Menu16"  | "Menu32"  | "Thin"]
 Id="String"
 MaxHeight="String"
 Scrollable="true"
 Sequence="Integer"
 Title="String">
 [<Controls /> | <Gallery />]
</MenuSection>

Seems that you could define different types of display mode.

http://msdn.microsoft.com/en-us/library/gg334378.aspx

于 2012-09-14T06:54:37.117 に答える
-1

splitButton を宣言するときは、size 属性を「small」に設定します。

于 2012-09-13T14:24:41.390 に答える