hi,
i wrote an activex control in vc++, but now i want to add scroll bars to it. how can i do this? or may be i should implement the scrollbars in the container? it will be a VB form and i dont have much experience with VB
SCROLLINFO ScrollInfo;
ScrollInfo.cbSize = sizeof(ScrollInfo); // size of this structure
ScrollInfo.fMask = SIF_ALL; // parameters to set
ScrollInfo.nMin = 0; // minimum scrolling position
ScrollInfo.nMax = 100; // maximum scrolling position
ScrollInfo.nPage = 40; // the page size of the scroll box
ScrollInfo.nPos = 0; // initial position of the scroll box
ScrollInfo.nTrackPos = 0; // immediate position of a scroll box that the user is dragging
m_VScrollBar.SetScrollInfo(&ScrollInfo);
</code>
VScrollBar is defined in the header
now just override OnSize:
<code>
COleControl::OnSize(nType, cx, cy);
int size=GetSystemMetrics(SM_CXVSCROLL);
m_VScrollBar.SetWindowPos(NULL,cx-size,0,size,cy-size,SWP_NOZORDER);
</code>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.