kakamna
asked on
How to Make Edit Control Read Only
I have created a View Drived from FormView. Also I have Inserted a
Edit Box from Resource Editor on My Dialog/Form. Now i want to
make the Edit Control Read Only at RunTime(by code not on Intial Setting).
Edit Box from Resource Editor on My Dialog/Form. Now i want to
make the Edit Control Read Only at RunTime(by code not on Intial Setting).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hi,
u can also use
m_edit.ModifyStyle(0,ES_RE ADONLY,0);
to get the read only property
cheers
u can also use
m_edit.ModifyStyle(0,ES_RE
to get the read only property
cheers
To RAVID: what your code does is makeing a edit box disabled, which is not exactly the same as read-only: In a read-only edit box the user can still select the text and copy it to the clipboard, in a disabled edit box the user cannot select any text.
To set a edit box to read-only just use the CEdit::SetReadOnly() function, i.e.:
m_edit.SetWindowText(...);
m_edit.SetReadOnly( TRUE );
hope that helps,
ZOPPO