15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Resizing a MDI MainFrame to a single child frame

DAVISTOD@gw2k.com
Monday, May 06, 1996

Environment: VC 4.1, NT 3.51 and Win 95, 100 MHz Pentium 32 MB

I have an app that will have at least two FormViews.  Only one view will be 
displayable at a time.  I want the MainFrame to shrink to wrap the child 
frame.  The child frame has already been sized to perfectly fit the form 
view using ResizeParentToFit.

I figure this will require some call to SetWindowPos or SetWindowPlacement, 
but I'm not entirely sure where would be a good place to put it!

Thanks,
Todd M. Davis
Software Engineer
Gateway 2000



Kevin_L_McCarthy.IACNET@ngate.zis.ziff.com
Thursday, May 09, 1996

[Mini-digest: 2 responses]

>I have an app that will have at least two FormViews.  Only one view will be 
>displayable at a time.  I want the MainFrame to shrink to wrap the child 
>frame.  The child frame has already been sized to perfectly fit the form 
>view using ResizeParentToFit.

If you make your app SDI, you won't have to worry about this. The "collections"
sample that comes with VC4.0 shows one way to have multiple views in an SDI app.
If you actually have multiple documents, you can still use SDI - it is possible 
to register
multiple doc templates (in InitApp, I think).
-----From: "Mike Blaszczak" 

From: 	owner-mfc-l@netcom.com on behalf of DAVISTOD@gw2k.com
Sent: 	Thursday, May 09, 1996 00:09

> Environment: VC 4.1, NT 3.51 and Win 95, 100 MHz Pentium 32 MB

Thanks.

> I want the MainFrame to shrink to wrap the child frame.
> The child frame has already been sized to perfectly fit the form 
> view using ResizeParentToFit.

So, this is an MDI application?  If you want this maximized-snap-fit thing 
happening, what would be the difference between your MDI application with that 
feature and an SDI application that can show two views?  Maybe you should have 
a look at the ENROLL sample to see how little difference there would be.

> I figure this will require some call to SetWindowPos or SetWindowPlacement, 
> but I'm not entirely sure where would be a good place to put it!

I guess I would do it ActivateFrame().

.B ekiM
TCHAR sz[] = _T("Watch your heel, crush, crush.");




| Вернуться в корень Архива |