Click to See Complete Forum and Search --> : How to make a scrollbar on an ActiveX Control window?


trillion
April 4th, 1999, 11:20 PM
I want to make a scrollbar on an ActiveX control
window. How to do it?
Could you give me some examples?
Thanks!!!

David Swigger
April 5th, 1999, 01:47 AM
Heres a tip:

Look into Drawing Text onto a DC using a clipping
region...

CString Text;
GetWindowText(Text);
CRect tmprect = rcBounds;

TempDC.SetBkMode(TRANSPARENT);
tmprect.left += m_ScrollPosX;
tmprect.right += m_ScrollPosX;
tmprect.top += m_ScrollPosY;
tmprect.bottom += m_ScrollPosY;

TempDC.DrawText(Text,tmprect,0);
David Swigger


Please don't tell me it's impossible. That just means I have to proove it...

trillion
April 5th, 1999, 02:07 AM
What I mean is I want to add a scrollbar onto an
ActiveX control window,that is ,how a scrollbar
can be display on an ActiveX control window?
Could you give me some examples about that?
Thank you very much.

Allen Yuh
April 5th, 1999, 11:09 AM
You can use CFormView to contain the ActiveX control. If the ActiveX control displays content larger than the view area, the CFormView will automatically create scrollbar(s). But, you need to ceate message handlers for WM_HSCROLL, WM_VSCROLL, WM_SIZE and maybe WM_MOUSEWHELL to change the view position in the ACtiveX control.

Hope this will help. Good luck.

Allen