Re: How to make TextBox read only but look normal
- Posted by ArthurCrump Jul 07, 2009
- 1342 views
Quoting just a little of Dan's last message:
"In any event, I continued to post regarding the matter because the method I thought to suggest, namely altering the STYLE of the edit box between read only and editable, with removeStyle( id, style ), DIDN'T ACTUALLY WORK, and I couldn't see why not." ... Dan
I have also tried removeStyle and found that it doesn't work. However, several posts ago, Thomas indicated how the style could be removed. I have tried this and it DOES WORK. I repeat:
w32VOID = sendMessage(Ebox,EM_SETREADONLY,True,0)
When the Edit box is READONLY, it can receive focus and a portion may be selected even though the contents cannot be changed.
If you prefer it to be genuinely disabled and unable to receive focus, have you tried putting it in a Group control and disabling the Group control instead of the Edit box?