Why is Copy / Cut / Paste NOT working in RichTextBox? It works my previous projects.

VKSB 196 Reputation points
2024-05-06T17:36:06.9066667+00:00

Hi All,

I am unable to "Copy" the text output in a RichTextBox in a project created in Visual Studio 2013.

In my previous projects, I can "Copy" text from RichTextBox.

I found out on Googling that for RichTextBox, it is necessary to write code for "Copy / Cut / Paste"; but I have not written any code for "Copying".

Could you please help me.

Thanks

VKSB

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,601 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 27,241 Reputation points Microsoft Vendor
    2024-05-07T06:23:16.9333333+00:00

    Hi @VKSB ,

    Verify that the keyboard shortcuts (Ctrl+C for Copy, Ctrl+X for Cut, Ctrl+V for Paste) are not overridden or disabled elsewhere in your application. Sometimes, other controls or forms might have these shortcuts bound to different actions.

    Try using Clipboard.SetText Method to copy the text from the richtextbox to the clipboard.

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Dewayne Basnett 1,356 Reputation points
    2024-05-08T16:09:43.9333333+00:00

    Make sure that the .ShortcutsEnabled property is set to True for the RichTextBox.

    0 comments No comments