Solved

Modification of window style parameters in MS Visual C++

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

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: 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
sameEnds challenge 3 196
Unix Command -- Challenging  question 7 106
Annoying "thing" blocks my view 4 146
Adjust the codes 3 63
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.

738 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