Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8364715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:29:20+00:00 2026-06-09T12:29:20+00:00

I have 2 questions. first i wanna do something like these following codes that

  • 0

I have 2 questions. first i wanna do something like these following codes that prevent (CTRL + C ) in a textbox but it won’t work. it won’t show anything in the messagebox.

The second question is how i can do something when the user pressed ( CTRL + C ) nothing will save in clipboard or automatically delete the value after pressing ( CTRL + C )

Here is the code :

 private void textBox1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.C && e.KeyCode == Keys.LControlKey)
        {
            MessageBox.Show("NOT ALLOWED");
        }

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:29:22+00:00Added an answer on June 9, 2026 at 12:29 pm

    You’re comparing the KeyCode for equality against two different values, and it’ll never be both. I think you meant to check for Control:

    if(e.KeyCode == Keys.C && e.Control) {
        MessageBox.Show("NOT ALLOWED");
    }
    

    As for stopping the copy operation, it should be as easy as:

    e.SuppressKeyPress = true;
    

    And you can always clear the clipboard using:

    Clipboard.Clear();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So this was one of my very first questions here, but I have a
I have two questions regarding array: First one is regarding following code: int a[30];
For my first table i have questions like this: qid | question | date
I know that similar questions to this have been asked before but after doing
I have some questions with relationship of ef code first. My code: public class
I have two questions. (First) I'm trying to make it where whenever the iPhone
I have two questions, actaully... First off, Why cant I do this: List<Object> object
I am writing my first FireFox extension and I have some questions. Maybe someone
Hey everyone, I want to start using Scheme and I have two questions. First,
I'm working through the Stanford iPhone podcasts and have some basic questions. The first:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.