-
July 16th, 2019, 03:48 PM
#1
Are EnableWindow and SetReadOnly mutually exclusive?
I have an edit box that, initially at the creation of this program, was set to be disabled under most circumstances. Disabling the box disabled all controls as well, which was problematic because the scrollbar would be inactive despite there sometimes being a large amount of text in these boxes. My fix was to instead change these boxes to read only in the situations that they were originally disabled. For knowledge sake, I'm wanting to ensure that these two functions are exclusive. For example, when I disable a box first then immediately after try to set it to read only, the box never changes. It stays disabled. So it made me curious of how this actually works (for what it's worth, I'm extremely naive when it comes to most things MFC).
-
July 17th, 2019, 01:55 AM
#2
Re: Are EnableWindow and SetReadOnly mutually exclusive?
1. It has nothing to do with MFC. It is just plain Win32:
EnableWindow(controlHandle, TRUE) / EnableWindow(controlHandle, FALSE) - to enable/disable control window.
SendMessage(controlHandle, EM_SETREADONLY , TRUE) / SendMessage(controlHandle, EM_SETREADONLY , TRUE) - to set/reset edit control readonly.
2. As you see these two operations are independent.
Victor Nijegorodov
-
July 17th, 2019, 11:01 PM
#3
Re: Are EnableWindow and SetReadOnly mutually exclusive?
Btw, MFC window related classes are simply classes that wrap native Win32 window functionality.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|