GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Oct-2005, 03:12
shvalb
 
Posts: n/a
Question

Creating CEdit dynamically


Hi.

I try to create a dynamic CEdit control using the .Create() method, and it is created ok, BUT, I only manage to create the control with a black line border and not as nice as if I would create it from the tools-box then it would have a 3d look or some kind of depth...what style or what do I have to do in order to make it look as if I would create it from the tools-box ??

Thanks.
  #2  
Old 28-Oct-2005, 13:17
frug frug is offline
New Member
 
Join Date: Oct 2005
Posts: 9
frug is on a distinguished road

Re: Creating CEdit dynamically


shvalb,

The 3D border is an extended style, so you can either add the extended style to the Edit you created or use the Edit's CreateEx funtion.

To get the edit to look like the edit from the tool box you also have to set the font of the window.

Here is a small sample.
CPP / C++ / C Code:
m_dynEdit.CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T("Initial text"), 
	ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
	CRect(10, 10, 100, 100), this, 1);

if(::IsWindow(m_dynEdit.GetSafeHwnd()))
{
	::SendMessage(m_dynEdit.GetSafeHwnd(), WM_SETFONT,
		(WPARAM)(HFONT)GetStockObject(DEFAULT_GUI_FONT), FALSE);
}
Felix
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with dynamically allocating 3d arrays pl39xh C Programming Language 7 03-Jul-2005 11:13
CCOmboBox: how to catch event dynamically shvalb MS Visual C++ / MFC Forum 1 02-Jan-2005 14:30
Help creating lists of pointers The_Kingpin C Programming Language 0 11-Dec-2004 13:49
Problem with the function creating updating a linked list nkhambal C Programming Language 3 28-Oct-2004 20:45
Creating dynamic links on a multi column Dave Gale MySQL / PHP Forum 1 01-Oct-2004 18:37

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:20.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.