Solved

CEdit::CreateEx problem

Posted on 2000-02-24
5
631 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 50 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

708 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

12 Experts available now in Live!

Get 1:1 Help Now