Contact me
   My PGP Key

Context menu sample

How to get this code going: Create a Windows Presentation Foundation project named ContextMenuSample and paste the following code in the specified file.

Paste this code into Window1.xaml:

<Window x:Class="ContextMenuSample.Window1"
    Title="Window1" Height="300" Width="300">
        <TextBox Margin="20,20,28,47" Name="textBox1" TextWrapping="Wrap">
                    <MenuItem Command="ApplicationCommands.Paste"></MenuItem>
                    <MenuItem Command="ApplicationCommands.Copy"></MenuItem>
                    <MenuItem Command="ApplicationCommands.Cut"></MenuItem>
            Right-click on me to see the context menu. Select text to cut and paste from the context menu.

Compile and run.

Comment in the forum

Sitemap generated by Sitemap Manager