whoasked
whoasked

Reputation: 420

Check read only status of CRichEditCtrl

I learnt today that the Clear() method of CRichEditCtrl only works when the control is not read only. I want to be able to restore the existing read only status once I've cleared the contents, but I don't see a way of checking the status in the first place. I could of course keep track of when it's being set to read only, but it'd be nice to be able to query it directly. Is there a way of doing this?

Thanks

Upvotes: 0

Views: 192

Answers (1)

xMRi
xMRi

Reputation: 15385

Use GetStye:

bool bReadOnly =  (m_wndRTFEdit.GetStyle() & ES_READONLY)!=0;

Upvotes: 1

Related Questions