Stacked Combo box and caption

173
1
03-26-2024 01:12 PM
MK13
by
New Contributor III

Currently, the Pro combo box has the caption showing up side by side with the combo box. In a bid to save space on the addin toolbar, I am looking to have the caption show up stacked with the combo box. Is it possible to do that with the sdk?

@CharlesMacleod @Wolf @UmaHarano 

0 Kudos
1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

You can create CustomControl. Then customize it as you want. For example:

  <UserControl x:Class="RibbonControls.CustomControl1View"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
             xmlns:ui="clr-namespace:RibbonControls"
             xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             d:DataContext="{Binding Path=ui.CustomControl1ViewModel}">
            <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Label Content="My Combobox" />
        <ComboBox Grid.Row="1" />
    </Grid>
</UserControl>

It will look like this:

GKmieliauskas_0-1711488807922.png

I have modified RibbonControls sample