Re: How to make TextBox read only but look normal

new topic     » goto parent     » topic index » view thread      » older message » newer message

OK, this works. If you have a flag - I called it ROflag - which is True to make the control RO, and false to allow RW. You intercept the w32HEvent flag, and you test ROflag. If true do a returnValue(). This stops everything. But that includes painting. So you would need to leave ROflag false until the control is painted, setting it again afterwards to make the control inviolate.

You would probably be best to save the flag value in the main window onPaint handler, clearing it to allow the text to be painted, and restoring it after to the RO or RW state.

Does this make sense? It isn't terribly hygienic but it works. You can't do ANYTHING to the text box if the w32HEvent returnValue()'s.

Now we wait for Derek to tell us how it SHOULD be done...

Andy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu