Problem with sizing CFormView in MDI app
Sheir Rahman Ali -- al930088@omega.scs.carleton.ca Sunday, June 16, 1996 Hi all, I am developing a MDI app for Win3.x using MSVC 1.52c. My app has multiple doc types, 4 of them. Each doc type have one CFormView, which of course translates to 4 dialog resources. I want the child frame to size to the dialog resource. So I followed the KB article on just this item. It worked great for 2 of my doc types but a vertical scroll bar shows up on the other 2 doc types. WHY??? The only explanation I can come up with is that the 2 dialog resource that worked have a height of about 161 pixels. The two that have a scroll bar have a height of about 196 pixels. Apparently any dialog resource that is over 161 pixels causes the scroll bar to appear. Why does this happen? Has anyone come across this before? How do I size my cformview so that the scroll bar does not appear? Any help would be appreciated. Thanks rahman ******************************************* * Sheir Rahman Ali * * "Licensed Remote Controll Operator" * *******************************************
Frederic Steppe -- FredericS@msn.com Monday, June 17, 1996 > I want the child frame to size to the dialog resource. >So I followed the KB article on just this item. >It worked great for 2 of my doc types but a vertical scroll bar >shows up on the other 2 doc types. WHY??? > The only explanation I can come up with is that the 2 >dialog resource that worked have a height of about 161 >pixels. The two that have a scroll bar have a height of >about 196 pixels. Apparently any dialog resource that is >over 161 pixels causes the scroll bar to appear. You probably have to call ResizeParentToFit(FALSE), the FALSE value for the bShrinkOnly parameter allows the view to grow if necessary. Frederic Steppe (frederics@msn.com)
funduc@sprynet.com Monday, June 17, 1996 Hi, If you overrode the CFormViews (which you'll now have to), add: GetParentFrame()->RecalcLayout(); SetScaleToFitSize(CSize(0,0)); in the OnInitialUpdate() override. This seems to not be very well documented but it works. On Sun, 16 Jun 96, Sheir Rahman Aliwrote: >Hi all, > I am developing a MDI app for Win3.x using MSVC 1.52c. >My app has multiple doc types, 4 of them. Each doc type >have one CFormView, which of course translates to 4 >dialog resources. > I want the child frame to size to the dialog resource. >So I followed the KB article on just this item. >It worked great for 2 of my doc types but a vertical scroll bar >shows up on the other 2 doc types. WHY??? > The only explanation I can come up with is that the 2 >dialog resource that worked have a height of about 161 >pixels. The two that have a scroll bar have a height of >about 196 pixels. Apparently any dialog resource that is >over 161 pixels causes the scroll bar to appear. >Why does this happen? Has anyone come across this before? >How do I size my cformview so that the scroll bar does >not appear? Any help would be appreciated. > >Thanks >rahman > > > > >******************************************* >* Sheir Rahman Ali * >* "Licensed Remote Controll Operator" * >******************************************* > Mike Funduc Funduc Software Inc. 102372.2530@compuserve.com funduc@sprynet.com http://ourworld.compuserve.com/homepages/funduc http://home.sprynet.com/sprynet/funduc
Gordon Weakliem -- gweakl@metronet.com Monday, June 17, 1996 At 12:09 PM 6/16/96 EDT, you wrote: > The only explanation I can come up with is that the 2 >dialog resource that worked have a height of about 161 >pixels. The two that have a scroll bar have a height of >about 196 pixels. Apparently any dialog resource that is >over 161 pixels causes the scroll bar to appear. >Why does this happen? Has anyone come across this before? >How do I size my cformview so that the scroll bar does >not appear? Any help would be appreciated. > I assume you've tried CFrameWnd::SizeParentToFit(FALSE) since you say you've looked at the kbase article. I'm curious to see what the scroll sizes are set to; maybe you can call CScrollView::SetScrollSizes(), though the framework should do that, I think somewhere in CFrameWnd::OnCreateClient(). Also, check to see that your dialogs are designed correctly - they have to be defined with certain styles in the .RC and maybe that's causing a problem during creation. Gordon Weakliem gweakl@metronet.com
| Вернуться в корень Архива |