[RESOLVED] help with context menu
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: [RESOLVED] help with context menu

  1. #1
    Join Date
    Jan 2008
    Posts
    40

    [RESOLVED] help with context menu

    I am trying to add copy and paste functionality to my form. I have not entered any code yet but when I run my project and right click on the combo box, there is a menu with select all, copy paste. But when I click on the richtextBox1 which is where I actually need the menu to pop up, nothing happens. I don't know why it shows on the combo box and not the richtextBox. can you explain?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: help with context menu

    Search Bing or Google for "richeditbox copy and paste C#"

  3. #3
    Join Date
    Jan 2008
    Posts
    40

    Re: help with context menu

    searching with those terms have given me better results. I think the biggest problem I have is that I don't know how to implement the code. Most of it looks like it doesn't pertain to me.

  4. #4
    Join Date
    Jan 2008
    Posts
    40

    Re: help with context menu

    I figured it out.

    I added a contextMenuStrip to the form, Added the Select All, Copy, Paste to the menu items, then clicked on the richTextBox1 and assigned the menu to the textBox. Then I clicked on each menu to enter it's click event and put in

    richTextBox1.Copy()
    richTextBox1.paste()
    richTextBox1.selectAll();

    into each click event

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center