Solved

CEdit::CreateEx problem

Posted on 2000-02-24
5
648 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
[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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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