1. Rich Edit Questions
- Posted by lockiedownunder Jun 26, 2009
- 990 views
1> How do I clear a RichEdit control? I tried clear(RichEd) but this didn't work.
2> How do a change a RichEdit control to and from "Read Only"? So as to only allow editing when it suits me.
2. Re: Rich Edit Questions
- Posted by DerekParnell (admin) Jun 26, 2009
- 1016 views
I haven't tried these ideas yet, as I'm about to go see Carlton beat Essendon ... anyhow ...
setText(RE, "") -- Clear the control. RE = create(RichEdit, "", aWin, x,y, w,h, ES_READONLY) -- read only control removeStyle(RE, {ES_READONLY, 0}) -- Take away readonly style addStyle(RE, {ES_READONLY, 0}) -- Add readonly style
I'm not sure if the remove/add style works with richedits as they have loads of quirks.
If not, then I'd suggest you have two controls - one readonly and one not - overlay each other, then when you want to use other or the other, just make visible the one you want.
3. Re: Rich Edit Questions
- Posted by lockiedownunder Jun 26, 2009
- 973 views
Thanks Derek, I didn't even try setText :( it works fine, I just assumed you had to stream text
Add and Remove style doesn't work so I will use your idea of using 2 RE overlayed. A bit messy bit it will do
Thanks again
4. Re: Rich Edit Questions
- Posted by LarryMiller Jun 26, 2009
- 1007 views
- Last edited Jun 27, 2009
Thanks Derek, I didn't even try setText :( it works fine, I just assumed you had to stream text
Add and Remove style doesn't work so I will use your idea of using 2 RE overlayed. A bit messy bit it will do
Thanks again
There is a better way. The EM_SETREADONLY message wil do what you want. The first paramater of the message will set readonly if TRUE. The message is documented under the Edit control but it also works for RichEdit controls.
Larry Miller
5. Re: Rich Edit Questions
- Posted by lockiedownunder Jun 27, 2009
- 971 views
Awesome thanks for your help Derek and Larry