CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2008
    Posts
    17

    How do I change the properties of a text box so the user cannot input text?

    Hi All,

    I am using C# visual express edition to code a windows form application. I have a text box, the user enters a string then presses a button on the form. I then want the text box to become inactive so the user cannot click on the text box and edit the information?

    What is the code to change the text box to make it inactive? Any help would be much appreciated.

    Thanks.......

  2. #2
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: How do I change the properties of a text box so the user cannot input text?

    use the ReadOnly or Enabled property

    Code:
    textBox1.ReadOnly = true;
    
    //or use this
    textBox1.Enabled = false;

  3. #3
    Join Date
    Nov 2008
    Posts
    17

    Re: How do I change the properties of a text box so the user cannot input text?

    Thanks mate- that works perfectly................

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured