Solved

Another question on dialog controls

Posted on 1999-01-06
4
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 55
Expand macro to ask for filename column 8 40
Process filename extension 3 218
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 134
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

732 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