开发者

How do I change what appears when right clicking in a rich text box in C#?

开发者 https://www.devze.com 2023-03-14 05:30 出处:网络
So in a rich text box (in Visual C#.NET) when I highlight some text and then right click with my mouse nothing happens.

So in a rich text box (in Visual C#.NET) when I highlight some text and then right click with my mouse nothing happens.

How do I make that little right click window pop up? How do I set the options for it?开发者_如何学编程


     ContextMenu contextMenu = 
        new System.Windows.Forms.ContextMenu (
           new [] {
             new MenuItem ("Entry1", ContextMenuItem_Click),
             new MenuItem ("Copy", ContextMenuItem_Click)
           });
     RichTextBox rtb = 
       new RichTextBox
         {
            Size = ClientSize,
            Parent = this,
            ContextMenu = contextMenu
         };
0

精彩评论

暂无评论...
验证码 换一张
取 消