Results 1 to 5 of 5

Thread: Read only textbox greyed out. (vs 2003)

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Location
    Coventry, England.
    Posts
    58

    Read only textbox greyed out. (vs 2003)

    Hello there, does anyone know how to make the background of a readonly textbox still be white - as in instead of greyed out?

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,817

    Re: Read only textbox greyed out. (vs 2003)

    Quote Originally Posted by husky1
    Hello there, does anyone know how to make the background of a readonly textbox still be white - as in instead of greyed out?
    Hi,

    Mark your TextBox as Read Only then go to de Backcolor to White.

    Wkrm

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2006
    Location
    Coventry, England.
    Posts
    58

    Re: Read only textbox greyed out. (vs 2003)

    Cheers, I feel pretty stupid, but then again it should show as grey not white in the backcolour once you've marked as readonly - that's why I thought it couldn't be changed - cos that already showed as white. Oh well, live and learn, thanks again!

  4. #4
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,817

    Re: Read only textbox greyed out. (vs 2003)

    Quote Originally Posted by husky1
    Cheers, I feel pretty stupid, but then again it should show as grey not white in the backcolour once you've marked as readonly - that's why I thought it couldn't be changed - cos that already showed as white. Oh well, live and learn, thanks again!
    It must be : in the properties of the textbox go to Readonly = true,
    then go to Backcolor = Web colors = White and that's it!

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,470

    Re: Read only textbox greyed out. (vs 2003)

    Technically you shouldn't set the BackColor to White. The BackColor of a regular TextBox is the system colour Window, so that if the user changes the Windows theme to use a colour other than white for their window backgrounds your TextBox will follow suit.

    Having said that, the change in BackColor is a visual cue to the user to indicate that they cannot enter data into the field. If I see a TextBox that looks exactly the same as any other TextBox but won't let me type anything then I think the app is broken. If I see a different BackColor then I know that there is something different, and because it is exhibiting the default Windows behaviour for a read-only TextBox then I know that I'm not supposed to be able to enter anything. I suggest that you leave it as is, but to each their own.

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