Solved

CEdit Looks vs EDITTEXT?

Posted on 2000-05-12
3
359 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
[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 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 50 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

623 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