Solved

Another question on dialog controls

Posted on 1999-01-06
4
168 Views
Last Modified: 2013-11-20
I recently learned how to disable a CButton control prior to opening a modal dialog box with the following code:

CButton *cb = (CButton *)GetDlgItem(IDC_BUTTON);
cb->EnableWindow(FALSE);

I want to do something similar now.  What do I do if I want to make an edit control read only prior to opening the dialog box?
0
Comment
Question by:scs1
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
dvest earned 50 total points
Comment Utility
CEdit *ce = (CEdit *)GetDlgItem(IDC_EDIT1);
ce->SetReadOnly( TRUE );

Should work like a charm! :)

Hope this helps,
David

0
 

Author Comment

by:scs1
Comment Utility
It did indeed work like a charm!!! Thanks

P.S. where do you find these specifiers such as SetReadOnly??
0
 
LVL 1

Expert Comment

by:dvest
Comment Utility
 If using VC, pull up"help" then "search".  In this case CEdit or edit control is what you should look for.  In the bottom pane look for an entry that says "class members".  You'll access all kinds of great info for that control.  As a bonus, all the standard controls are derived from CWnd, so many CWnd functions are usable on the control as well!

Happy hunting,
David
0
 

Author Comment

by:scs1
Comment Utility
Thanks again
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now