Solved

Modification of window style parameters in MS Visual C++

Posted on 1997-03-27
4
875 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
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.
A short film showing how OnPage and Connectwise integration works.

929 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

10 Experts available now in Live!

Get 1:1 Help Now