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. Simulate BackSpace

Simulate BackSpace

Scheduled Pinned Locked Moved C#
question
2 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.
  • M Offline
    M Offline
    mihksoft
    wrote on last edited by
    #1

    Hy, How can I simulate a BackSpace on a RichTextBox in OnKeyPress or OnKeyDown methods? thx

    K 1 Reply Last reply
    0
    • M mihksoft

      Hy, How can I simulate a BackSpace on a RichTextBox in OnKeyPress or OnKeyDown methods? thx

      K Offline
      K Offline
      Kristian Sixhoj
      wrote on last edited by
      #2

      Write the following code in the RichTextBox's OnKeyPress or OnKeyDown event handler:

      SendKeys.Send("{BACKSPACE}");

      And that's it. If you don't want the user to write text in the RichTextBox, just set it's property ReadOnly to true instead of doing this. -- modified at 11:16 Thursday 27th September, 2007

      Virtual1ty


      "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

      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