CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Form View

  1. #1
    Join Date
    May 1999
    Posts
    4

    Form View

    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 ?



  2. #2
    Join Date
    Apr 1999
    Posts
    48

    Re: Form View

    Have you looked at CScrollView::ResizeParentToFit
    which is inherited into CFormView?

    Roger



  3. #3
    Join Date
    May 1999
    Posts
    4

    Re: Form View

    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?




  4. #4
    Join Date
    Apr 1999
    Posts
    48

    Re: Form View

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured