Click here to Skip to main content
15,907,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SetFocus for a chosen Edit Control in MFC Pin
toxcct9-May-04 10:23
toxcct9-May-04 10:23 
GeneralRe: SetFocus for a chosen Edit Control in MFC Pin
robert_s9-May-04 12:07
robert_s9-May-04 12:07 
GeneralRe: SetFocus for a chosen Edit Control in MFC Pin
David Crow10-May-04 3:06
David Crow10-May-04 3:06 
Questioncd writer programming.how? Pin
Mohsen Saad9-May-04 8:59
Mohsen Saad9-May-04 8:59 
AnswerRe: cd writer programming.how? Pin
Anthony_Yio10-May-04 1:19
Anthony_Yio10-May-04 1:19 
GeneralDymanic windows Pin
Alton Williams9-May-04 4:44
Alton Williams9-May-04 4:44 
GeneralRe: Dymanic windows Pin
Jens Doose10-May-04 0:11
Jens Doose10-May-04 0:11 
GeneralDymanic windows (clarified) Pin
Alton Williams13-May-04 3:29
Alton Williams13-May-04 3:29 
This is a snippets of my code
in the dialog header file
class CMyDialouge : public CDialog{<br />
public CEdit *m_EditWnd;<br />
CRect m_WndRect;<br />
};

The dialog's constructor
CMyDialouge::CMyDialouge(CWnd* pParent /*=NULL*/)<br />
	: CDialog(CMyDialogue::IDD, pParent)<br />
{<br />
m_EditWnd = NULL;<br />
m_Rect = CRect(23,30,54,14);<br />
}<br />

Create 5 versions of the edit control
BOOL CMyDialouge::OnInitDialog()<br />
{<br />
	// TODO: Add extra initialization here<br />
	this->m_EditWnd = new CEdit[5];<br />
	<br />
	for(int i = 0; i < 5; i++)<br />
	{<br />
		m_EditBox[i].Create(WS_CHILD|ES_MULTILINE| WS_VISIBLE|ES_WANTRETURN,CRect(0,0,0,0),this,1000 + i);<br />
		m_EditWnd[i].MoveWindow(m_Rect);<br />
		m_EditWnd[i].ShowWindow(SW_SHOW);<br />
<br />
		m_Rect.top += 30;<br />
	}<br />
	return TRUE;  // return TRUE  unless you set the focus to a control<br />
<br />
}

void CMyDialouge::OnDestroy<br />
{<br />
	for (int i=0; i <5; i++)<br />
		m_EditWnd[i].DestroyWindow();<br />
<br />
	CDialog::OnDestroy();<br />
	<br />
	// TODO: Add your message handler code here<br />
	delete[] m_EditWnd;<br />
}<br />


I hope I've clarified it.
Thanks Alton
GeneralRe: Dymanic windows (clarified) Pin
Jens Doose13-May-04 3:39
Jens Doose13-May-04 3:39 
GeneralRe: Dymanic windows (clarified) Pin
Alton Williams13-May-04 4:08
Alton Williams13-May-04 4:08 
GeneralRe: Dymanic windows (clarified) Pin
Jens Doose13-May-04 4:44
Jens Doose13-May-04 4:44 
GeneralRe: Dymanic windows Pin
David Crow10-May-04 3:07
David Crow10-May-04 3:07 
GeneralRe: Dymanic windows Pin
Alton Williams13-May-04 3:33
Alton Williams13-May-04 3:33 
GeneralRe: Dymanic windows Pin
marcosvpp10-May-04 5:54
marcosvpp10-May-04 5:54 
GeneralRe: Dymanic windows Pin
Jens Doose13-May-04 3:46
Jens Doose13-May-04 3:46 
GeneralRe: Dymanic windows Pin
Marcos Vinícius13-May-04 4:51
sussMarcos Vinícius13-May-04 4:51 
GeneralNewbie DLL Question Pin
Hagiel9-May-04 4:37
Hagiel9-May-04 4:37 
QuestionHow to move caret around in characters in an Edit control? Pin
Gary Shen9-May-04 4:33
Gary Shen9-May-04 4:33 
AnswerRe: How to move caret around in characters in an Edit control? Pin
Ravi Bhavnani9-May-04 6:24
professionalRavi Bhavnani9-May-04 6:24 
GeneralSplitter window question Pin
Chakrdeep9-May-04 3:15
Chakrdeep9-May-04 3:15 
GeneralRe: Splitter window question Pin
Ravi Bhavnani9-May-04 4:22
professionalRavi Bhavnani9-May-04 4:22 
GeneralIP lister... Pin
Snyp9-May-04 3:03
Snyp9-May-04 3:03 
GeneralRe: IP lister... Pin
Andrew Walker9-May-04 3:25
Andrew Walker9-May-04 3:25 
GeneralRe: IP lister... Pin
Ravi Bhavnani9-May-04 4:25
professionalRavi Bhavnani9-May-04 4:25 
GeneralRe: IP lister... Pin
Snyp9-May-04 4:28
Snyp9-May-04 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.