Another question on dialog controls

Posted on 1999-01-06
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);

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?
Question by:scs1
  • 2
  • 2

Accepted Solution

dvest earned 50 total points
ID: 1327300
CEdit *ce = (CEdit *)GetDlgItem(IDC_EDIT1);
ce->SetReadOnly( TRUE );

Should work like a charm! :)

Hope this helps,


Author Comment

ID: 1327301
It did indeed work like a charm!!! Thanks

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

Expert Comment

ID: 1327302
 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,

Author Comment

ID: 1327303
Thanks again

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sum28 challenge 31 112
wait notify demo infinite loop 3 110
ShiftLeft challenge 21 82
wordappend challenge 8 179
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

810 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