|
-
February 26th, 2009, 02:32 AM
#1
how to add ScrollBar to Dialog
I have added Vertical ScrollBar to my Dialog.I have added variable m_ScrollBarto to it and set its range.
m_ScrollBar.SetScrollRange(0,10);
I have to add Eventhandler to ScrollBar.How to add WM_VSCROLL message map
to it.If I press ctrl+w class wizard is not coming.How to open Class wizard Dialog Box. Can anyone suggest me.
-
February 26th, 2009, 03:37 AM
#2
Re: how to add ScrollBar to Dialog
Using ctrl+w to invoke class wizard only apply to VC6, are you using VC6?
-
February 26th, 2009, 04:58 AM
#3
Re: how to add ScrollBar to Dialog
Hi,
I am using Visual Studio 2005.
-
February 27th, 2009, 12:57 AM
#4
Re: how to add ScrollBar to Dialog
There is no similar ctrl+w class wizard in VS2005. However you can always hand-code the event handler code.
Copy below code to your class definition.
Code:
protected:
// Generated message map functions
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
Copy below code to your class implementation.
Code:
BEGIN_MESSAGE_MAP(CScrollBarDlg, CPropertyPage)
ON_WM_HSCROLL()
ON_WM_VSCROLL()
END_MESSAGE_MAP()
void CScrollBarDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
}
void CScrollBarDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
}
Last edited by ckweius; February 27th, 2009 at 09:03 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|