|
-
December 24th, 2006, 11:54 PM
#1
How to set an Edit in a Dialog read-only?
All,
I have a problem like this:
I use a CString member to exchange data with CEdit using DDX, now I sometimes want the CEdit to be read-only, how can I implement this?
Thanks a lot.
-
December 25th, 2006, 12:03 AM
#2
Re: How to set an Edit in a Dialog read-only?
I found a function "CWnd* GetDlgItem( int nID ) const" which may be used to resolve this problem, do you think so?
-
December 25th, 2006, 12:39 AM
#3
Re: How to set an Edit in a Dialog read-only?
Set the Read Only property of the edit box to be TRUE. The DDX/DDV routines work fine even if the edit box is read only.
You can do it this way as well:
Code:
CString strText;
GetDlgItem (IDC_TEXT)->GetWindowText (strText);
"I rather not play football than wear Nerrazzuri shirt" - Paolo Maldini
FORZA MILAN!!!
-
December 25th, 2006, 01:31 PM
#4
Re: How to set an Edit in a Dialog read-only?
Err... CEdit::SetReadOnly?
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
|