Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CEdit Looks vs EDITTEXT?

Posted on 2000-05-12
3
Medium Priority
?
360 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 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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…
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 learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

722 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