Re: How to make TextBox read only but look normal
- Posted by bernie Jul 06, 2009
- 1353 views
The user must have a visual clue that the field is not editable. You cannot just stop accepting events in the field because the user will not know that the program has changed state. You really have to show the user that the field is a no-go area. This GUI 101.
The simpliest way is to use setEnable(..., 0) and have the background colour change from the normal input scheme. That is why I suggest that during the program's form creation step, it should call setDisableBg() to set which colour to show when it's been disabled. That is all that has to be done! No fancy footwork or behind ther scenes redirecting of events.
There are many ways you can give visual hints that the field is disabled, but this is by far the easiest. I also suggested that one can change the colour of the text itself, but you could change the font/border/whatever..., but you have to do something.
Any field that looks like an input field should be editable. If it's not editable then it should not look like an input field.
Derek: Couldn't they just setup a tooltip that would warn the user
when the users mouse hovers over the text box ?