Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Key Press Event : ctrl + C

Key Press Event : ctrl + C

Scheduled Pinned Locked Moved C#
questionhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bonzaiholding
    wrote on last edited by
    #1

    Hi, I have a RichTextBox and i want to do something when the user press on the RichTextBox with the combination of the keys : ctrl + 'C'. I created this event :

    private void m_richTextBox1_KeyUp(object sender, KeyEventArgs e)
    {
    if (e.Control && e.KeyData== Keys.C)
    {
    //Do Something
    }
    }

    but when the user press on the keys it's recognize only the 'ctrl' key and not the char 'C'. What is the problem and what should i do? 10X.

    D 1 Reply Last reply
    0
    • B bonzaiholding

      Hi, I have a RichTextBox and i want to do something when the user press on the RichTextBox with the combination of the keys : ctrl + 'C'. I created this event :

      private void m_richTextBox1_KeyUp(object sender, KeyEventArgs e)
      {
      if (e.Control && e.KeyData== Keys.C)
      {
      //Do Something
      }
      }

      but when the user press on the keys it's recognize only the 'ctrl' key and not the char 'C'. What is the problem and what should i do? 10X.

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      In either KeyDown or KeyUp

      if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control)
      {
      //
      }

      Dave
      Generic BackgroundWorker - My latest article!
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Why are you using VB6? Do you hate yourself? (Christian Graus)

      B 1 Reply Last reply
      0
      • D DaveyM69

        In either KeyDown or KeyUp

        if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control)
        {
        //
        }

        Dave
        Generic BackgroundWorker - My latest article!
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Why are you using VB6? Do you hate yourself? (Christian Graus)

        B Offline
        B Offline
        bonzaiholding
        wrote on last edited by
        #3

        Thanks for your help.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups