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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:51:38+00:00 2026-06-04T13:51:38+00:00

In my case, I have a TextBox and two buttons Button1 and Button2. Here

  • 0

In my case, I have a TextBox and two buttons Button1 and Button2. Here is how I am doing..

private void Button1_click()
{
   TextBox.IsReadOnly = false;
}

private void Button2_click()
{
   TextBox.IsReadOnly = true;
   this.Focus()
}

Now the flow, what I am doing…

  1. Program loads, I click on the TextBox, the SIP appears and I click somewhere on the screen the keyboard disappears.
  2. I press Button2 and the TextBox becomes read only and the SIP disappears (if it was shown)
  3. I tap on the TextBox (while it is still in the read only mode)
  4. I press Button1, and click on the TextBox.. BOOOMM.. the program crashes with an UnHandledException.

…

I have tried gotfocus() and LostFocus of TextBox but nothing seems to help, Just before crashing, the GotFocus of the TextBox is NOT called. I tap on the textBox and suddenly it crashes.

Really trying to figure out what could be wring for the last 9 hours (oh yeah, I am dumb programmer 🙂

Could anyone please put some light on the problem and tell me any possible solution?

Thanks very much 🙂

  • 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-06-04T13:51:39+00:00Added an answer on June 4, 2026 at 1:51 pm

    After working really hard on this issue, I finally used two separate textBoxes and set the visibility true/false on the button clicks.

    I removed all the events of the TextBox, I simplified the code (properties values and events) to as much extent as possible but the code was crashing.

    One thing I noticed though,

    As in the 4th point in my questions, I clicked on the Button1, then on the textBox and it was crashing. But when I did it like “press Button1, click anywhere on the screen, and then clicking the TextBox didn’t crash)

    Strange!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two pages: Default.aspx and Target.aspx. On Default.aspx are two buttons: Button1 redirects
In my case I have panels,but to make it clear I will use buttons
I have two radio buttons on my MVC page. When I click on 'Yes'
Html text box should have same font size for both upper and lower case
In case I have .NET framework installed in my computer + all the necessary
I have a regular .NET application. In this case I have a part that's
I'm new to codeigniter this is my case: I have a homepage with a
I have the following case: All boats have a boat type like shark ,
I have this case <WrapPanel> <CheckBox>Really long name</CheckBox> <CheckBox>Short</CheckBox> <CheckBox>Longer again</CheckBox> <CheckBox>Foo</CheckBox> <Slider MinWidth=200
I have a case where i want to submit a form and get the

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.