Click to See Complete Forum and Search --> : Form View


T. Viard
May 1st, 1999, 12:53 PM
I want the frame to be the exact size of the view. I don't manage to do that. I think I have to set for one hand the scroll size of the view, and for other hand to resize the frame.
Am I right ?

Roger Osborn
May 1st, 1999, 02:40 PM
Have you looked at CScrollView::ResizeParentToFit
which is inherited into CFormView?

Roger

T. Viard
May 2nd, 1999, 07:33 AM
thanks for the tip, I don't use the CScrollView so often. I put this code in my view :



void CBopView::OnSize( UINT nType, int cx, int cy )
{
CFormView::OnSize( nType, cx, cy ) ;

if ( GetParentFrame()->GetSafeHwnd() )
{
SetScaleToFitSize( CSize( 100, 100 ) ) ;
ResizeParentToFit() ;
GetParentFrame()->RecalcLayout() ;
}
}




I don't manage to get the size of the dialog template of the form. Do you have any type for this?

Roger Osborn
May 2nd, 1999, 10:58 AM
Sorry, I should have given an example. The following code seems to work in VC++6:

void CFormtestView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit(FALSE);
}


Cheers,
Roger