Hello,
I created a formview with nested controls. My problem is setting the correct values for vertical scroll size so that I can scroll thru the complete range of the view. At the moment, my code cannot scroll to the bottom of the view.
My code:
void CMyFormView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
#define MM_SCALETOFIT (-1)
CRect rectFrame;
CFrameWnd* pFrame = GetParentFrame();
ASSERT_VALID(pFrame);
pFrame->GetWindowRect(rectFrame);
CSize size = rectFrame.Size();
SetScrollSizes(MM_TEXT, size);
….
}
Notice in the left portion of the attached screen capture that the scroll thumb occupies almost the entire vertical scrollbar which limits the range to scroll.
I found out that if I increased the cy member of CSize, the scrollbar thumb is smaller and it now allows me to scroll down to the bottom of the formview.
See right portion of the screen capture.
My question is what do I need to do to set the correct value for CSize?
I assume I will also need the same code to change the scroll size when the user resizes the frame window in the call to OnSize.
Thank you for your assistance.
↧