2008/10/13

Dialog 위에 ScrollView 올리기


////////////////////////////////////////////////////////////////////////
//On View

//header
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName
, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd
, UINT nID, CCreateContext* pContext = NULL);


//source
BOOL CSampleView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName
, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd
, UINT nID, CCreateContext* pContext)
{
return CWnd::Create(lpszClassName, lpszWindowName,
dwStyle, rect, pParentWnd, nID, pContext);
}

int CSampleView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest
, UINT message)
{
return MA_ACTIVATE;
//return CScrollView::OnMouseActivate(pDesktopWnd, nHitTest, message);
}

////////////////////////////////////////////////////////////////////////
//On Dialog

CRect rt;
GetClientRect(rt);
m_pScrollView = new CSampleView();
m_pScrollView->Create (NULL, NULL, WS_VISIBLE | WS_CHILD,
rt, this, 10000, NULL);

CSize sizeTotal;
sizeTotal.cx = sizeTotal.cy = 100;
m_pScrollView->SetScrollSizes(MM_TEXT, sizeTotal);

Original Post : http://neodreamer-dev.tistory.com/182

No comments :

Post a Comment