CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Posts
    53

    Resizing Mdi Child Window

    Hi there,

    I want to make the Mdi child length same as the mainframe available length in the client area.

    How can I find out what is the length of the available client area of mainframe.

    How can I change the length of the mdi child with the same length.

    Also when I change some x or y coordinated of the cs structure of mdi child window in Precreatewnd function I don't see any child window at all.Even though the title bar shows that the document object is being created.Can anybody throw some light on this problem.

    Thanx in advance.


  2. #2
    Join Date
    Aug 1999
    Location
    Bulgaria
    Posts
    236

    Re: Resizing Mdi Child Window

    CRect rect;
    CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
    pMain->GetClientRect(&rect);
    CChildFrame* pChild = (CChildFrame*)MDIGetActive();
    pChild->MoveWindow(rect);


  3. #3
    Join Date
    May 1999
    Posts
    53

    Re: Resizing Mdi Child Window

    Hi there,

    Your piece of code is great. It works very well.I do have some more question, if you could help me.

    1. How can I calculate exact size of free client area in Mdi Main Frame window.I mean Mdi Main Frame has Menu Bar, Tool Bar and Status Bar.How can I calculate the available client area excluding those windows.

    2. Your piece of code I have sticked into Mainframe onsize function.Is it the right place to do it ?

    3. When I have more than one Mdi child activated how I can get hold of each of them and resize all of them.

    Thanx very much for your help.

    Tapas
    [email protected]


  4. #4
    Join Date
    Aug 1999
    Posts
    427

    Re: Resizing Mdi Child Window

    Hi ric,
    Have you ever heard that client area in MDI application is reprezented by MDIClient not by CMainFrame. This object has no class in MFC but you can Subclass it. CMainFrame has handle to it.
    However I'm not gona send you in Zimbabve.
    (Mejdu drugoto priznavam che s trieneto na kontrol be mnogo glupavo,kakvo da pravis sluchvat se zatamnenia)
    :-)


  5. #5
    Join Date
    Aug 1999
    Location
    Bulgaria
    Posts
    236

    Re: Resizing Mdi Child Window

    Oh, man, you want to send ME to Zimbabve. You will subclass the MDIClient just to take its size. Oh, boy, ti neshto pak si v zatumnenie. Znaesh kvo niakoi den ako ti doide prosvetlenie pak se obadi da podiskutirame tui onui. A mejdu drugoto vij choveka kakvo e kazal za moia kod. Vsichko kazano dotuk e napulno v priatelski ton, taka che do not be insulted in some way, vsichko e na maitap i da se porazseiat the boring discussions over here.


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