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 5933027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:54:59+00:00 2026-05-22T14:54:59+00:00

I use the TextChanged event of a textbox. for instance I have the text

  • 0

I use the TextChanged event of a textbox.

for instance I have the text in the textbox:
“a b”- 2 spaces between a,b
I go in the middle of the 2 spaces, and hit backspace. I can not check by comparing the new text with the old which key was pressed (if backspace or delete was pressed, the newtext is the
same “a b”-1 space between letters.

How can I check which key was pressed?

  • 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-05-22T14:54:59+00:00Added an answer on May 22, 2026 at 2:54 pm

    Why do you care? If you’re handling the TextChanged event, you’re not supposed to care what about the text was changed, just the fact that it was.

    If you need to care about what specifically was changed, you need to handle a lower-level event, like KeyDown:

    private void OnKeyDownHandler(object sender, KeyEventArgs e)
    {
        if (e.Key == Key.Back || e.Key == Key.Delete)
        {
            // The user deleted a character
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can use Interaction.Triggers to catch the textchanged event on a textbox like so:
I have the following binding in my wpf application xaml: <TextBox Text={Binding Amount, StringFormat=c}
I have a textbox on an asp.net page. I use a barcode scanner to
Use case: 3rd party application wants to programatically monitor a text file being generated
Use case: I've just entered insert mode, and typed some text. Now I want
I have some code where I am trying to use variables in a tabpage.
I'm used to programming in C# and I frequently bind to the TextChanged event,
I have a group of usercontrols that I use multiple instances of through out
I have a gridview which contains a text box as a template field.the grid
I currently have a windows form application composed of a textbox and two buttons

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.