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. richTextBox

richTextBox

Scheduled Pinned Locked Moved C#
4 Posts 3 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.
  • S Offline
    S Offline
    sarojkumarjena
    wrote on last edited by
    #1

    can i get some unique value when I will press the backspace in the following event private void richTextBox1_TextChanged(object sender, System.EventArgs e)

    G 1 Reply Last reply
    0
    • S sarojkumarjena

      can i get some unique value when I will press the backspace in the following event private void richTextBox1_TextChanged(object sender, System.EventArgs e)

      G Offline
      G Offline
      Gammaza
      wrote on last edited by
      #2

      Try it by selecting the keypressed property for the textbox then checking when backspace is pressed. You KeyPreview should also be true i think. e.KeyCode = BackSpace or Back or something like that.

      S 1 Reply Last reply
      0
      • G Gammaza

        Try it by selecting the keypressed property for the textbox then checking when backspace is pressed. You KeyPreview should also be true i think. e.KeyCode = BackSpace or Back or something like that.

        S Offline
        S Offline
        sarojkumarjena
        wrote on last edited by
        #3

        Only on TextChanged event not in key press

        M 1 Reply Last reply
        0
        • S sarojkumarjena

          Only on TextChanged event not in key press

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          No. You get what the event's name is indicating: The Text property has changed, nothing more, nothing less. For example, if your cursor is at the beginning of the text, pressing Backspace will not modify the text, so no TextChanged event will occur. To find out how the text has changed you'll have to save the previous version of the text and compare it with the new value.

          Regards, mav -- Black holes are the places where god divided by 0...

          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