?
Solved

Scaling CFormView

Posted on 1998-06-17
5
Medium Priority
?
354 Views
Last Modified: 2013-11-20
I have written an order enty program that uses a CFormView dialog resource as the main screen.  The PC I used to develop the code was in 800 X 600 mode.  Now that other users are using the program, they are getting annoying scroll bars even when in 800 X 600 and without any other desktop interference (Office Bar, Start Bar, etc)
My ultimate goal is to resize the CFormView to fit at either 640 X 480, 800 X 600, and 1024X768.  How do programmers usually deal with different display settings?  Also, why are there scroll bars on every other system at 800 X 600 but not on mine?  I have tried using various combinations of SetScaleToFitSize() and GetParentFrame()->RecalcLayout() which eliminate the scroll bars but don't show the entire form. If its important the form contains a tree, listview, a RichEdit, and a bank of buttons at the top.  I can live without the status bar if necessary.  Thanks!
0
Comment
Question by:badges
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:badges
ID: 1318122
Edited text of question
0
 

Author Comment

by:badges
ID: 1318123
VC++ 5 Win95
0
 
LVL 2

Expert Comment

by:Belgarat
ID: 1318124
How should the controls on the form do after you resize it ? Should they change their sizes accordingly / move around ? Or do you want them to stick in upper left area of the resized dialog window ?

0
 
LVL 3

Accepted Solution

by:
shaig earned 200 total points
ID: 1318125
Use:
::GetSysInfo()    ( or GetSysMetrics, i don't remmember which )

you can also query the desktop window about it's size.
0
 

Expert Comment

by:alesatang
ID: 1318126
The Contradiction Between Flexibility and Rapid Development
-The condition of Dialog-based Windows and Size-Position Adaptation
Alesa Tang
Shanghai Bell SNA
98.6
Many programmer suffer pains when image to exploit the CFormView, CRecordView or CDialogBar to implement a Interface Rapidly and precisely. Because if the window*s size and position change, the dialog*s appearance will always be out of control. This kind difficulties are not only in VC, but also other tools like VB or Delphi.
Yes, its is easy to use dialog editor to locate the controls* position, size. But the dialog template has fixed physical location. The alternative is create the control dynamically as a child window in a view or controlbar. But these processes seem to be a little more laborious So a developer should make compromization when choose Rapid Develop or Flexibility.
Before make decision, the analysis should be taken carefully. There is two category of interface controls:
--Flexible Controls: CEdit, CTreeCtrl, CListCtrl,
--Not so flexible: Buttons, Radios, Checkboxes.
Which category is dominate in a interface? If the Flexible controls is major part, like the ClassView of the Visual Studio, a dynamic strategy should be selected. If you want outstanding effect, the labor is valuable. Other wise, the dialog template path might be better.
There is some factors shoul be take into consideration when create dynamic control:
1. The parent window*s OnSize should adjust the these child controls size and Position, like:
void COutputWnd::OnSize(UINT nType, int cx, int cy)
{
      CControlBar::OnSize(nType, cx, cy);
      if(cx>0)
      {
            RECT rc;
            GetClientRect(&rc);
            m_TabCtrl.MoveWindow(&rc);
            rc.left+=5;rc.right-=5;
            rc.top+=28;rc.bottom-=5;
            m_Terminal.MoveWindow(&rc);
            m_Terminal.RedrawWindow();
            m_AlarmHisList.MoveWindow(&rc);
      }
}

2. In dynamic controls case, if the 3D effect is wanted, you should draw some border lines manually.
Ref.
The Dockable PropertySheet in C++ topic group


0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question