I have a WPF RichTextBox and I want to add some more options to the default context menu. I dont want to loose the default menu options (Cut, Copy, Paste). Can you help me out?
Thanks
Extending the previous answer:
<RichTextBox x:Name="rtbTest">
<RichTextBox.ContextMenu>
<ContextMenu>
<MenuItem Command="ApplicationCommands.Cut"/>
<MenuItem Command="ApplicationCommands.Copy"/>
<MenuItem Command="ApplicationCommands.Paste"/>
<MenuItem Header="Custom Item"/>
</ContextMenu>
</RichTextBox.ContextMenu>
</RichTextBox>
Each command is provided with a default UI Text and Key Gesture, by omitting them (in this case the 'Header') from your definition they will fallback to the default, which will be in the users own preferred language.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With