Solved

CEdit::CreateEx problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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

13 Experts available now in Live!

Get 1:1 Help Now