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

Thread: Urgent

  1. #1
    Join Date
    Apr 1999
    Posts
    12

    Urgent

    Thank You in advance for sparing your time. I have a Single document view.View is derived from CFormView. Now I need to resize the frame to exactly to the size of my view.



    Looking for help.

    Thank you
    Gajjela


  2. #2
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    100

    Re: Urgent

    I am not quite sure whether my method will work for your app.
    I guess it will... But I have used in my dialog window and worked.

    If you could get your formview size, use "CalcWindowRect()" function
    which will return the size of window that is just big enough
    to hold a given client rectanle size. Then use "SetWindowPos()"
    function to resize your frame window.

    Good luck.

    Walter An


  3. #3
    Join Date
    Apr 1999
    Posts
    383

    Re: Urgent

    Gajjela,

    usually the view is sized to the frame...

    Dave


  4. #4
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: Urgent

    In your frame windows' OnSize :


    void C....Wnd::OnSize(UINT nFlags, int cx, int cy)
    {
    // assumes view is m_pView
    CFrameWnd::OnSize(nFlags, cx, cy);
    CRect rectClient;
    GetClientRect(&rectClient);
    m_pView->MoveWindow(rectClient);
    }




    Darwen.


    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

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