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

  • Home
  • SEARCH
  • 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 8678693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:47:16+00:00 2026-06-12T20:47:16+00:00

Today I account a question, In c# winform program. if there are Form A

  • 0

Today I account a question, In c# winform program.

if there are Form A and Form B; Form B has a textbox (need to read only)

The Form A code like this:

B b = new B("FormB");
b.Show();

The FormB code like this:

Situation1:

public B(string str)
{
   this.textbox1.text = str;

   this.textbox1.Enable = false;
}

I deploy the program to customer server, but the textbox1.text = "", have no value, but it works in my local computer.

I try this:

Situation2:

public B(string str)
{
    this.textbox1.text = str;

    this.textbox1.ReadOnly = true;        
}

Then texbox1.text = "FormB"; it works in my local computer and customer server.

The key and important question is ,why the situation1 can works my local computer not works in customer server?

Can anybody tell this is why?

  • 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-12T20:47:17+00:00Added an answer on June 12, 2026 at 8:47 pm

    Let me see if I understand you correctly, you are asking why the text on the TextBox is updated when you use ReadOnly = true and not Enabled = false?


    If so, I guess it’s by design.

    From MSDN: TextBoxBase.ReadOnly Property

    When this property is set to true, the contents of the control cannot
    be changed by the user at runtime. With this property set to true, you
    can still set the value of the Text property in code.
    You can use this
    feature instead of disabling the control with the Enabled property to
    allow the contents to be copied and ToolTips to be shown.

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

Sidebar

Related Questions

God i feel like i'm spamming stackoverflow, this is my 3rd post for today.
I know this question has been asked a million times in various ways by
As of...today, it seems, Google Maps no longer has embed code! Can someone point
Today, I have read that command's object in WPF can be serialized. And I'm
Today I came up with a question about the web application conventions. For the
Ok this is something weird. I got authlogic-oid installed in my rails app today.
My application, created today, runs fine when I use it with my account. On
I may have string like, Hello, %(name)s, how are you today, here is amount
Hi this question or problem i have its very hard i have search and
Today is jQuery day. I found this in the documentation: blur() Returns: jQuery Triggers

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.