Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CEdit::CreateEx problem

Posted on 2000-02-24
5
Medium Priority
?
674 Views
Last Modified: 2013-11-20
Hi,
I want to create an editable CEdit with
3d look. When I used CEdit::Create, I
the attribute WS_EX_CLIENTEDGE was not
recognized. So I used CreateEx. The
following is is my code:

CString wclass = AfxRegisterWndClass(WS_EX_CLIENTEDGE, 0, 0, 0);


m_myedit.CreateEx(WS_EX_CLIENTEDGE, wclass, NULL, WS_CHILD | WS_VISIBLE | ES_LEFT | ES_MULTILINE | WS_BORDER | ES_AUTOVSCROLL | ES_WANTRETURN
 , rect, this, IDC_MY_NAME_EDIT, NULL);


The edit control becomes uneditable though Iam not passing ES_READONLY attribute anywhere. It is grey in color.
(instead of white)

0
Comment
Question by:meerak
  • 3
  • 2
5 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 150 total points
ID: 2556361
m_myedit.CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), NULL, WS_CHILD | WS_VISIBLE | ES_LEFT | ES_MULTILINE | WS_BORDER | ES_AUTOVSCROLL | ES_WANTRETURN
 , rect, this, IDC_MY_NAME_EDIT, NULL);
0
 
LVL 1

Author Comment

by:meerak
ID: 2556364
Sorry I forgot to mention.  m_myedit is
a class derived from CEdit.

I have
class CCustomEdit : public CEdit
{
......
....
}

That's why I had to do AfxRegisterWndClass and
get the class name
0
 
LVL 23

Expert Comment

by:chensu
ID: 2556705
You should not register a class yourself, the class name of an edit control must be "EDIT". You actually created a normal window instead of an edit control. Try my code.
0
 
LVL 1

Author Comment

by:meerak
ID: 2556832
I thought since Iam not using CEdit
directly, I registered the class and
passed it to CreateEx. Let me try what
to suggested and let you know tomorrow.
Thanks.
0
 
LVL 1

Author Comment

by:meerak
ID: 2569961
Thanks. It works now
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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…
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

879 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