Solved

CEdit Looks vs EDITTEXT?

Posted on 2000-05-12
3
352 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 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

705 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

16 Experts available now in Live!

Get 1:1 Help Now