Solved

CEdit::CreateEx problem

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Smart Camera scanning and reading information 3 106
Modbus - whats the maximum I can store in one register? 4 79
scoreUp challenge 14 62
Problem to open Excel file 15 131
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 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