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. Short C ut Keys

Short C ut Keys

Scheduled Pinned Locked Moved C#
helpquestion
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.
  • A Offline
    A Offline
    Agyeman
    wrote on last edited by
    #1

    How do I trap the ctrlZ, ctrlc and ctrlv on a rich text box from executing when pressed. Please help Nana

    L 1 Reply Last reply
    0
    • A Agyeman

      How do I trap the ctrlZ, ctrlc and ctrlv on a rich text box from executing when pressed. Please help Nana

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      I believe the following should work, derive from RichTextBox.

      protected override bool IsInputChar(char charCode)
      {
      switch ((int) charCode)
      {
      //these are CTRL + char = (int) char
      case 1: //CTRL + A
      case 3: //CTRL + C
      case 6: //CTRL + F
      case 22: //CTRL + V
      case 24: //CTRL + X
      case 26: //CTRL + Z
      case 27: //ALT + right, i think
      case '\t':
      case 8:
      case 10: //CTRL + D == Enter
      case 13:
      return false;
      }
      }

      xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!

      A 1 Reply Last reply
      0
      • L leppie

        I believe the following should work, derive from RichTextBox.

        protected override bool IsInputChar(char charCode)
        {
        switch ((int) charCode)
        {
        //these are CTRL + char = (int) char
        case 1: //CTRL + A
        case 3: //CTRL + C
        case 6: //CTRL + F
        case 22: //CTRL + V
        case 24: //CTRL + X
        case 26: //CTRL + Z
        case 27: //ALT + right, i think
        case '\t':
        case 8:
        case 10: //CTRL + D == Enter
        case 13:
        return false;
        }
        }

        xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!

        A Offline
        A Offline
        Agyeman
        wrote on last edited by
        #3

        it not work. thanks you for oyur help Nana

        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