Solved

Another question on dialog controls

Posted on 1999-01-06
4
179 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
ID: 1327300
CEdit *ce = (CEdit *)GetDlgItem(IDC_EDIT1);
ce->SetReadOnly( TRUE );

Should work like a charm! :)

Hope this helps,
David

0
 

Author Comment

by:scs1
ID: 1327301
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
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,
David
0
 

Author Comment

by:scs1
ID: 1327303
Thanks again
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

679 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