Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C# ReadOnly Text Colour

  • 26-04-2006 1:13am
    #1
    Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,137 Mod ✭✭✭✭


    I have a textbox on my form that has the readonly property set to true. The problem is the grey colour of the text makes it harder to read the data in the text box. I was wondering if there was a way to change the colour of the text when the text box is set to readonly (or when enabled is set to false).

    Any help would be great.


Comments

  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,137 Mod ✭✭✭✭AlmightyCushion


    Sorry had the text box disabled not readonly. I was looking at the code of a different form. Too late for this stuff.


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    Yeah - Readonly won't (i.e. shouldn't) change the colour at all, and will still allow you to do stuff like select teh text to copy. Disabling (i.e. Enabled = false), on the other hand....does exactly what you describe.

    In both cases, you should always be able to manually set the foreground and background colours after setting the readonly/enabled. However, just one word of caution - if you use "Custom" colours, instead of the predefined ones (e.g. Window, Control, etc.), then accept that if someone is using a different colour-scheme to you, you may just have made things look awful for them.

    jc


  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,137 Mod ✭✭✭✭AlmightyCushion


    bonkey wrote:

    if you use "Custom" colours, instead of the predefined ones (e.g. Window, Control, etc.), then accept that if someone is using a different colour-scheme to you, you may just have made things look awful for them.

    Yeah I learnt that lesson yesterday. I was putting a program on my friends laptop to demo my project and the forms I spent so long designing and giving them pretty colours were turned back to that drap grey colour. I couldn't be arsed changing all the forms so I just left them the way they were. So many hours wasted.


Advertisement