????? ??????? ??? CFormView ?? ??????? ????? (MDI) ????? ?????? "?" ????? ????? ????? (SDI)

?????? ????????? ?????? ?????????
???? ???????: 98598 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

?????? ????? Microsoft Visual C++ .NET (2002) ????? ????????? ???????? ??????? ???? ?? ??????? ?? ??? Microsoft .NET Framework ?????? ????? ????????? ???????? ??? ???????? Microsoft Windows ??????. ????? ????????? ??????? ?? ??? ??????? ??? ??? ????????? ???????? ??? ???????? Visual C++.

?????? ????? Microsoft Visual C++ 2005 ????? ????????? ???????? ??????? ???? ?? ??????? ?? ??? Microsoft .NET Framework ?????? ????? ????????? ???????? ??? ???????? Microsoft Windows ??????.

??????

??? CFormView ???? ????? ?????? ???? ????? ?????? ?? ????? ??? ???? ????? ??? ???? ???? ????. ????? ??? ???????? CFormView ????? ?? ??????? ?????? ????? ?? ????? ?? ??????? ????? VIEWEX ? CHKBOOK ????? ?? 2.x ????????? ???? Foundation ?? Microsoft "(MFC) ?????. ??? ???? ??? ????????? ?? ???? ????? ????? ?????? ?? ???? ?????? ???? ????? ?????? ?? ???????.

???? ?????? ?????? ??????? ???????? ???? ????? ????? ????? ????? (SDI) ?? ?????? ????? (MDI) ????? ????? ????? ??? CFormView ????? ??? ???? ?????? ?????? ??? ??????? ????? ??? ?????? ?????? ????? MDI ???????? ?? ?? ???????.

??????? ????

??? ??????? ??????? ????? ????? AppWizard MFC ??????? ?????? ?? CFormView ?????? ??? ????????:
  1. ?????? AppWizard ?????? ????? SDI ?? MDI. ???? ??? ??? ????? ???? ???? ???? ?????? ??????? ????? ??? ???? ??????? ????? ??.

    Visual Studio 6.0:

    ?? ?????? 6 ?? AppWizard ????? ??? ????? ?????. ?? ???? ??????? ?????? ????? ???????? ??? CFormView ?????? CFormView ????? ????????.

    Visual Studio .NET ?? Visual Studio 2005:

    ?? ?????? 1 ?? AppWizard ??? ???? ????????. ?? ???? ??????? ?????? ????? ???????? ??? CFormView ?????? CFormView ????? ????????.
  2. ????? ?????? ????? OnUpdate() ???????? UpdateData() ??? ????? ?? ????? CFormView ????? ??????? ??? ???????? ??????? ?????? ?? ????? ???????? ?????? ????? (DDX).

    ??????: UpdateData ??? ??????? ????? ??????? ????? ???????? ???? ???? DoDataExchange ???? ?????? ???????? ?? ??? ?????. ????? ????? ????? CFormView ???????? ?? UpdateData.
  3. ??? ??? ???? ?? ????? ????? ?????? ?? ????? ????? "?????" ????? ???? OnInitialUpdate(). ???? ??????? ????? ???? ??????? ?????? ??? ??? ??????? ?? ?????? ?????? ?? ????? SDI ?? MDI.

????? ??? ?????? ??????? SDI ??? CFormView

?????? ??? ?????? ??????? SDI ????? (?????? CFormView ???? ????? ????? ?????? ??) ?? ???? ??? ??????? ??????? ?? ??????? ?? ??????? Studio ????? ???? OnInitialUpdate() ?? ????? ??????? ????? ?? CFormView ? ??? ???:
      void CMyFormView::OnInitialUpdate()
      {
         CFormView::OnInitialUpdate();
         GetParentFrame()->RecalcLayout();
         ResizeParentToFit(); // default argument is TRUE
      }
				
?? ???? ?????? ResizeParentToFit() ??????? ?? ????? ??? ????? ???? ???????? ?????? ??? ???? ??????? ??????? (????? ??????? ??? ????? ???????? ??? ??? ?????). ?????? ??? ???? ?????? ????? ????? ??? ?????, ????? ????? ???? PreCreateWindow() ?? ??? CMainFrame ???? ?? ??????? ?????? AppWizard. ??? ???? ??????? ??? ????? ??? WS_THICKFRAME ??? ???????? ?? ????? ??? ??????, ???? ?????? PreCreateWindow() ?? MAINFRM.H ?????? ???????? ???????? ??????? ??? MAINFRM.CPP:
      BOOL CMainFrame::PreCreateWindow(CREATESTRUCT &cs)
      {
         cs.style &= ~WS_THICKFRAME;
         return CFrameWnd::PreCreateWindow(cs);
      }
				

????? ??? ???????? ??????? MDI ??? CFormView

???? ????? ????? ??? ???? MDI ?????? ??? ????? ??? ???? ????? ???? ????????? SDI ??? ?? ???? ?????. ??? ???? ??????? RecalcLayout() ??? ?????.

?????? ??? ???? MDI ?????? ??? ????? ??? ????? ????? ???? OnInitialUpdate() ?? ????? ??????? ????? ?? CFormView ??? ???:
      void CMDIFormView::OnInitialUpdate()
      {
         CFormView::OnInitialUpdate();
         ResizeParentToFit(); // Default argument is TRUE.
      }
				
??? ????? ??????? ??????? ?????????? ?????? ResizeParentToFit() ? ???? ??? ??????? ???? ????? ?? ????? SDI ??? ?? ???? ?????. ???????? ??? ???? ?? ???? ?????? ?????? ???? ???? ?? ?????? ??????? MDI ?????? ?? ?????? ???????.

?????? ??? ?????? ?????? MDI (??? ???? ??????? ?????? ??? WS_THICKFRAME ???? ?? ???? ???????? ????? ??? ??????) ?????? ????? ???? MDI ???? ?????? ?????? PreCreateWindow ??? ?? ????? ?? ?????? SDI ?????.

????? ????? MDI ?? ??

?????? ?? ?? ????? ????? ??????? ????? ????? ????? ?????? BN_CLICKED ??? ??? CFormView. ???? ?? ?? ??????? ???????? ?? CFormView ?? ???? ??? ??????? IDOK ?? IDCANCEL ?????????. ??? ???? ????? ?? ???? ????? ??????? ??? ????? ?? ???? ????? ???????? ??? ???? ???????.

????? ????? ????? ?? ???? ????? ?????? ????? "?????" ?? "???" ??????? ?? ????????? ???????? ???????:
      void CMyForm::OnClickedButton1()
      {
         PostMessage(WM_COMMAND, ID_FILE_CLOSE);
      }
				
??? ??????? ?????? ????? ????? ???????? ???? ????? ?? ???? ????? ?????? ????? IsModified() ???????? ???????? TRUE.

???????

???? ???????: 98598 - ????? ??? ??????: 05/?? ?????/1426 - ??????: 4.0
????? ???
  • Microsoft Foundation Class Library 4.2, ????? ?????? ??:
    • Microsoft Visual C++ 1.0 Professional Edition
    • Microsoft Visual C++ 1.5 Professional Edition
    • Microsoft Visual C++ 1.51
    • Microsoft Visual C++ 1.52 Professional Edition
    • Microsoft Visual C++ 1.0 Professional Edition
    • Microsoft Visual C++ 2.0 Professional Edition
    • Microsoft Visual C++ 2.1
    • Microsoft Visual C++ 5.0 Standard Edition
    • Microsoft Visual C++ 6.0 Service Pack 5
    • Microsoft Visual C++ .NET 2003 Standard Edition
    • Microsoft Visual C++ .NET 2002 Standard Edition
    • Microsoft Visual C++ 2005 Express Edition
????? ??????: 
kbmt kbdocview kbhowto kbmdi kbuidesign KB98598 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????98598

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com