Advertisement

Disabled edit control still allows editing?

Started by August 28, 2000 04:38 PM
2 comments, last by Shaterri 24 years, 4 months ago
I''m currently working on the configuration dialog for the screensaver I''m putting together and I''ve run into a minor, but strange and frustrating, problem with it. I have an edit control that gets enabled or disabled according to other dialog box options; it works fine to the extent that the text is successfully greyed out (or ungreyed), but while the control is disabled and grey the user can still do all the usual editing within the text box: new keys, backspace, cut and pace, etc. I don''t have a code snippet handy at the moment, but does this sound like a familiar problem to anyone?
Send the EM_SETREADONLY message to the edit control, with wParam set to TRUE, and lParam set to ''0'' (zero), set wParam to FALSE to turn it off, If that is what you have been doing and it has not been working, you may want to look into how you are creating the dialog box or edit control,..if you need any help with the above advice (like sending the message or finding the HWND for it, feel free to ask)




-Lucas
-Dieraxx@programmer.net
-Lucas
Advertisement
No, the only message I''ve been sending to the control has been a WM_ENABLE message; everything I''ve read seemed to suggest that that was the only one that had to be sent. Do you really have to send WM_ENABLE _and_ EM_SETREADONLY? I can certainly try that... let you know how it works later (I''m still wrapping up at work here right now and all my code is at home)
Maybe it''s better to use the EnableWindow() Win32 function...

This topic is closed to new replies.

Advertisement