Solved

CEdit Looks vs EDITTEXT?

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

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

785 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