Solved

Modification of window style parameters in MS Visual C++

Posted on 1997-03-27
4
882 Views
Last Modified: 2013-11-20
When a dialogue window, such as a button or an edit box, is created, many of its styles can be set by corresponding edit tools at beginning. My question is how to change those styles in program.

In use of MS Visual C++ V4.x, there are a lot of parameters which can be found in the .rc file, Can they be changed via some functions?

For example, there is a text edit box with an ID of "IDC_TEXT_EDIT" and a style of "ES_READONLY". One line in the .rc file looks like:

EDITTEXT IDC_TEXT_EDIT,110,30,15,12,ES_UPPERCASE|ES_READONLY

Can I set those parameters for their application window just like to set ES_READONLY off or on for a text edit box?
0
Comment
Question by:ysun
  • 2
  • 2
4 Comments
 

Author Comment

by:ysun
ID: 1300703
Adjusted points to 50
0
 

Expert Comment

by:skin
ID: 1300704
ysun,

Take a look at the member functions for the object you are trying to set the window styles of.  For example in CEdit there is a member function: SetReadOnly that will change this style.
0
 

Author Comment

by:ysun
ID: 1300705
I know that the SetReadOnly() is a member function of CEdit
and it can change the read-only style.I hope to know how to realized this. That is how to define the object with a "IDC_TEXT_EDIT" ID as CEdit.



0
 

Accepted Solution

by:
skin earned 50 total points
ID: 1300706
To associate IDC_TEXT_EDIT with a member of theCEdit class, right click on the edit box and select Class Wizard, then select the Member Variables tab.   Next double click on IDC_TEXT_EDIT in the control IDs column and assign a variable of type CEdit.  Now you'll be able to call SetReadOnly().

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.

792 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