Click here to Skip to main content
15,902,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCreate CEdit dynamicly Pin
dzenan15-Jul-03 3:06
dzenan15-Jul-03 3:06 
GeneralRe: Create CEdit dynamicly Pin
Cedric Moonen15-Jul-03 3:44
Cedric Moonen15-Jul-03 3:44 
GeneralRe: Create CEdit dynamicly Pin
dzenan15-Jul-03 4:02
dzenan15-Jul-03 4:02 
GeneralRe: Create CEdit dynamicly Pin
Cedric Moonen15-Jul-03 4:19
Cedric Moonen15-Jul-03 4:19 
GeneralRe: Create CEdit dynamicly Pin
dzenan15-Jul-03 4:35
dzenan15-Jul-03 4:35 
GeneralRe: Create CEdit dynamicly Pin
Navin15-Jul-03 6:40
Navin15-Jul-03 6:40 
GeneralRe: Create CEdit dynamicly Pin
Cyberizen15-Jul-03 8:50
Cyberizen15-Jul-03 8:50 
GeneralRe: Create CEdit dynamicly Pin
Iain Clarke, Warrior Programmer15-Jul-03 5:18
Iain Clarke, Warrior Programmer15-Jul-03 5:18 
Here goes...

In your header:
class CMyWnd : public CWnd
{
    ...

protected:
    CStatic m_StaticSubWnd;
    CEdit m_EditSubWnd;
    ....

};


In your implementation:
int CMyWnd::OnCreate (LPCREATESTRUCT lpC )
{
    m_StaticSubWnd.Create ("text here", WS_CHILD | WS_VISIBLE | SS_...,  // styles here, inc static styles
        CRect (0,0, lpC->cx, 24), this, 1);
    m_EditSubWnd.Create ( WS_CHILD | WS_VISIBLE | ES_..., // styles here, inc edit styles
        CRect (0,26, lpC->cx, lpC->cy - 26), this, 2);

    return CWnd::OnCreate (lpCreateStruct); // Not that it's much needed, but its good practice.
}


The coordinates are just examples. You can give them any coords you like.
You should handle WM_SIZE / OnSize and change the position / size of the subwindows when the size
of CMyWnd changes.

OK?

Iain.
GeneralRe: Create CEdit dynamicly Pin
dzenan15-Jul-03 6:14
dzenan15-Jul-03 6:14 
QuestionHow can I add a DLL to my VC++.NET? Pin
mr200315-Jul-03 2:49
mr200315-Jul-03 2:49 
AnswerRe: How can I add a DLL to my VC++.NET? Pin
dzenan15-Jul-03 3:12
dzenan15-Jul-03 3:12 
GeneralRe: How can I add a DLL to my VC++.NET? Pin
mr200315-Jul-03 4:03
mr200315-Jul-03 4:03 
GeneralRe: How can I add a DLL to my VC++.NET? Pin
dzenan15-Jul-03 5:14
dzenan15-Jul-03 5:14 
GeneralCan't load string from resource DLL's string table Pin
s_k15-Jul-03 1:17
s_k15-Jul-03 1:17 
GeneralRe: Can't load string from resource DLL's string table Pin
Mike Dimmick15-Jul-03 2:18
Mike Dimmick15-Jul-03 2:18 
GeneralRe: Can't load string from resource DLL's string table Pin
s_k15-Jul-03 2:26
s_k15-Jul-03 2:26 
GeneralRe: Can't load string from resource DLL's string table Pin
Mike Dimmick15-Jul-03 2:38
Mike Dimmick15-Jul-03 2:38 
GeneralRe: Can't load string from resource DLL's string table Pin
s_k15-Jul-03 3:14
s_k15-Jul-03 3:14 
GeneralMDI Application Pin
SatyaDY15-Jul-03 0:14
SatyaDY15-Jul-03 0:14 
GeneralRe: MDI Application Pin
Neville Franks15-Jul-03 1:32
Neville Franks15-Jul-03 1:32 
GeneralToolbar in CDialog Pin
_crs_14-Jul-03 23:22
_crs_14-Jul-03 23:22 
GeneralRe: Toolbar in CDialog Pin
iceage15-Jul-03 0:04
iceage15-Jul-03 0:04 
GeneralRe: Toolbar in CDialog Pin
_crs_15-Jul-03 1:29
_crs_15-Jul-03 1:29 
GeneralRe: Windows Service Pin
Mike Dimmick15-Jul-03 2:16
Mike Dimmick15-Jul-03 2:16 
GeneralRe: Windows Service Pin
Xiangyang Liu 刘向阳15-Jul-03 2:22
Xiangyang Liu 刘向阳15-Jul-03 2:22 

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.