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

x
?
Solved

CEdit Looks vs EDITTEXT?

Posted on 2000-05-12
3
Medium Priority
?
361 Views
Last Modified: 2012-06-21
When I use VS6 to create edit fields, the are implemented with the '3d' look.  As to say that they have an indented look via a white righ and bottom border and black Top and left.  When I create a text edit using the CEdit class, all I get is a white box.  When I add the WS_BORDER flag, it is outlines in black.  What is the key to get the '3d/indented' look?
0
Comment
Question by:zam62
3 Comments
 
LVL 2

Expert Comment

by:vbk_bgm
ID: 2806524
Try the foll in OnCreate:
m_Edit.Create(WS_CHILD | WS_VISIBLE | WS_BORDER, rect, pParent,IDC_MYEDIT);

rect is Edit contorl's rectangle
pParent = this (usually)
 
0
 
LVL 4

Accepted Solution

by:
saurabh_dasgupta earned 200 total points
ID: 2808066
You can try the following code, it works fine for me. I did this in the OnInit of a Dialog Box. It gives me a '3d look n feel' edit control.

CEdit *pMyEdit = new CEdit;
RECT rc = { 100,100,200,200};
pMyEdit->Create( WS_CHILD | WS_VISIBLE ,rc,this , 3000);

/**
alter extended the style of the edit control
**/
 
long nExistingStyle=0;
nExistingStyle=GetWindowLong (pMyEdit->m_hWnd , GWL_EXSTYLE);

nExistingStyle = (nExistingStyle | WS_EX_CLIENTEDGE);
SetWindowLong(pMyEdit->m_hWnd, GWL_EXSTYLE , nExistingStyle);

/**
flush the changes using SetWindowPos, otherwise you will see the same old 'plain' edit control
**/

pMyEdit->SetWindowPos(&wndTop, 0, 0, 0, 0,SWP_FRAMECHANGED | SWP_NOMOVE  | SWP_NOSIZE );
0
 

Author Comment

by:zam62
ID: 2810501
Thanks for the swift Answer!  It worked like a champ!  Now all I haffta do is get the font size and width to make it Great!

Again Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

916 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