This example demonstrates how to create a popup menu with Copy, Paste, Undo, and Redo commands (bar items). The menu is displayed when the user right-clicks in the text box.
The BarManager.DXContextMenu attached property is used to associate the menu with a TextBox
control:
<TextBox
...
<dxb:BarManager.DXContextMenu>
<dxb:PopupMenu>
<dxb:PopupMenu.Items>
<dxb:BarButtonItem
Content="Copy"
Glyph="pack://application:,,,/Images/copy16x16.png"
ItemClick="itemCopy_ItemClick" />
<dxb:BarButtonItem
Content="Paste"
Glyph="pack://application:,,,/Images/paste16x16.png"
ItemClick="itemPaste_ItemClick" />
<dxb:BarButtonItem
Content="Undo"
Glyph="pack://application:,,,/Images/undo16x16.png"
ItemClick="itemUndo_ItemClick" />
<dxb:BarButtonItem
Content="Redo"
Glyph="pack://application:,,,/Images/redo16x16.png"
ItemClick="itemRedo_ItemClick" />
</dxb:PopupMenu.Items>
</dxb:PopupMenu>
</dxb:BarManager.DXContextMenu>
</TextBox>
- Window1.xaml (VB: Window1.xaml.vb)
- Window1.xaml.cs (VB: Window1.xaml.vb)
(you will be redirected to DevExpress.com to submit your response)