dropDown

In the object model this is RibbonDropDown
The value returned is the list index.
a list of items the user can select
A dropdown control can contain items or even buttons after its selection items.
This control is similar to a gallery control but the gallery control also allows items to be arranged in a grid.
You cannot manipulate the buttons collections at runtime but you can show and hide existing buttons to create the equivalent of a dynamic list.
RibbonDropDown has an Items collection that contains RibbonDropDownItem controls.
This collection can be modified at runtime


<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> 
  <ribbon startFromScratch="true">
    <tabs>
      <tab id="CustomTab" label="My Tab">
        <group id="Group1" label="MyGroup">
          <dropDown id="MyDropDown"
                    label="Weekdays"
                    sizeString="AAAAAAAAAAAAAAAAAAAAAAA"
                    onAction="DropDown_OnAction">
            <item id="One" label="Mon"/>
            <item id="Two" label="Tue"/>
            <item id="Three" label="Wed"/>
            <button id="button" label="Button..." />
          </dropDown>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Attributes (properties)

enabled(Enabled) "true" | "false"
id(Id)
idMso 
idQ 
image(Image)
imageMso(OfficeImageId)
insertAfterMso 
insertAfterQ 
insertBeforeMso 
insertBeforeQ 
keytip(KeyTip)
label(Label)
screentip(ScreenTip)
showImage"true" | "false"
showItemLabel"true" | "false"
showItemImage"true" | "false"
showLabel"true" | "false"
size(ItemImageSize) size of the images displayed
sizestring(SizeString) "xxxxxxxx" ??
supertip(SuperTip)
tag(Tag)
visible(Visible) "true" | "false"
 (GenerateMember)
 (Buttons) add buttons to the list, can only be done at design-time
 (Items) add items to the list can also be done at run-time
 (Modifiers)

Children

This control can contain the following controls

Button 
Item 

C# Events (design-time)

These events can be accessed if you use the Visual Studio Ribbon Designer.

ButtonClick 
ItemsLoadingThe ItemsLoading event is raised before the dropdown is displayed
SelectionChangedOnAction attribute - This is the design-time equivalent of the run-time OnAction callback event

void DropDown_ButtonClick(object sender, 
                        RibbonControlEventArgs e)
{
}

void DropDown_ItemsLoading
{
}

void DropDown_SelectionChanged(
{
}

Callbacks (run-time)

onActionDropDown_OnAction - Fired when you choose an item in the drop-down
This is the run-time equivalent to the design-time SelectedChanged event
getEnabledDropDown_OnGetEnabled -
getImageDropDown_OnGetImage -
getImageMso 
getItemCountDropDown_OnGetItemCount -
getItemIDDropDown_OnGetItemID -
getItemImageDropDown_OnGetItemImage -
getItemLabelDropDown_OnGetItemLabel -
getItemScreentip 
getItemSupertip 
getKeytipDropDown_OnGetKeytip -
getLabelDropDown_OnGetLabel -
getScreentipDropDown_OnGetScreentip -
getSelectedItemIDDropDown_OnGetSelectedItemId -
getSelectedItemIndexDropDown_OnGetSelectedItemIndex -
getShowImageDropDown_OnGetShowImage -
getShowLabelDropDown_OnGetShowLabel -
getSupertipDropDown_OnGetSupertip -
getVisibleDropDown_OnGetVisible -

Public Sub DropDown_OnAction( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef dropdownID As String, _
   ByRef selectedIndex As Variant)

End Sub

' C# Equivalent
void DropDown_OnAction(
   Office.IRibbonControl control,
   string dropdownID,
   int selectedIndex)
{
}

Public Sub DropDown_OnGetEnabled( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Enabled As Variant)

End Sub

' C# Equivalent
bool DropDown_OnGetEnabled(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetImage( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Bitmap As Variant)

End Sub

' C# Equivalent
System.Drawing.Bitmap DropDown_OnGetImage(
   Office.IRibbonControl control)
{
   return new System.Drawing.Bitmap(Properties.Resources.untitled);
}

Public Sub DropDown_OnGetItemCount( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Count As Variant)

End Sub

' C# Equivalent
int DropDown_OnGetItemCount(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetItemID( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Index As Integer, _
   ByRef ItemID As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetItemID(
   Office.IRibbonControl control,
   int Index)
{
}

Public Sub DropDown_OnGetItemLabel( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Index As Integer, _
   ByRef ItemLabel As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetItemLabel(
   Office.IRibbonControl control,
   int Index)
{
}

Public Sub DropDown_OnGetKeytip( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Keytip As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetKeytip(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetLabel( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Label As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetLabel(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetScreentip( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Screentip As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetScreentip(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetSelectedItemID( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef SelectedItem As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetSelectedItemId(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetSelectedItemIndex( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef SelectedItemIndex As Variant)

End Sub

' C# Equivalent
int DropDown_OnGetSelectedItemIndex(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetShowImage( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef ShowImage As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetShowImage(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetShowLabel( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef ShowLabel As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetShowLabel(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetSupertip( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Supertip As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetSupertip(
   Office.IRibbonControl control)
{
}

Public Sub DropDown_OnGetVisible( _ 
   ByRef control As Office.IRibbonControl, _
   ByRef Visible As Variant)

End Sub

' C# Equivalent
string DropDown_OnGetVisible(
   Office.IRibbonControl control)
{
}


© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext