forum

Home / DeveloperSection / Forums / Adding combobox to Ribbon Control in XAML

Adding combobox to Ribbon Control in XAML

Anonymous User 3496 19-Aug-2014

I have a WPF Application with a Ribbon Control. I want to add a ComboBox, to show the logged in user next to the help button. But when I try to add the ComboBox, it is created as a Tab.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition></RowDefinition>
    </Grid.RowDefinitions>
    <Ribbon x:Name="RibbonWin" SelectedIndex="0" Margin="0,0,0,113">
        <Ribbon.HelpPaneContent>
            <RibbonButton SmallImageSource="Images\help.png"></RibbonButton>
        </Ribbon.HelpPaneContent>
        <RibbonComboBox>
            <ComboBoxItem Content="Test1"/>
        </RibbonComboBox>
        <RibbonTab Header="Home" KeyTip="H" Margin="0,0,0,-1" >
            <RibbonGroup x:Name="ClipboardGroup" Header="Clipboard">
                <RibbonMenuButton LargeImageSource="Images\paste.jpg"Label="Paste" KeyTip="V">
                    <RibbonMenuItem ImageSource="Images\paste.jpg"Header="Keep Text Only" KeyTip="T"/>
                    <RibbonMenuItem ImageSource="Images\paste.jpg"Header="Paste Special..." KeyTip="S"/>
                </RibbonMenuButton>
                <RibbonButton SmallImageSource="Images\cut.jpg"Label="Cut" KeyTip="X" />
                <RibbonButton SmallImageSource="Images\copy.jpg"Label="Copy" KeyTip="C" />
            </RibbonGroup>
            <RibbonGroup x:Name="Questions" Header="Questions And Answers">
                <RibbonMenuButton LargeImageSource="Images\Question.jpg"Label="Questions" KeyTip="V">
                    <RibbonMenuItem ImageSource="Images\paste.jpg" Header="Add Question" KeyTip="T"/>
                    <RibbonMenuItem ImageSource="Images\paste.jpg" Header="Paste Special..." KeyTip="S"/>
                </RibbonMenuButton>
                <RibbonButton SmallImageSource="Images\Save.jpg" Label="Save" KeyTip="X" />
                <RibbonButton SmallImageSource="Images\Add.jpg" Label="Add" KeyTip="C" />
            </RibbonGroup>
        </RibbonTab>
        <RibbonTab Header="Insert" KeyTip="I">
        </RibbonTab>
        <RibbonTab Header="PageLayout" KeyTip="L">
        </RibbonTab>
    </Ribbon>
</Grid>

Also is there a way to remove the the Application Menu ComboBox on the left that is created by default.


wpf wpf 
Updated on 19-Aug-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By