Solved

Modification of window style parameters in MS Visual C++

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

18 Experts available now in Live!

Get 1:1 Help Now