So my dilemma comes from making a UI in C++ with the windows API. I need to have an EDITTEXT box which allows for scrolling but doesn't allow the user to edit the text that gets displayed in the box. So far, it looks like this.
EDITTEXT ID_STATUS,7,237,439,50, WS_VSCROLL | ES_MULTILINE
This allows for the text to be scrolled if it's long and breaks it into new lines. However, if i add the DISABLED option to this, it disables both the scrollbar and the text. What would be the best way to solve this situation? I've also tried adding
SendDlgItemMessage(ID_STATUS, EM_SETREADONLY, 0, 0);
before the UI gets previewed to see if this would disable text editing but it doesn't. Any help would be appreciated.
EM_SETREADONLY
is correct but you failed to actually ask it to be read-only. Try
SendDlgItemMessage(ID_STATUS, EM_SETREADONLY, TRUE, 0);
wParam
Specifies whether to set or remove the ES_READONLY style. A value of TRUE sets the ES_READONLY style; a value of FALSE removes the ES_READONLY style.
You can also specify the ES_READONLY
style when you create the control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With