Chapter 16: Text-Based Controls Visual C++ and MFC Fundamentals
btnCancel->SetWindowPos(NULL, RectApply.left, RectApply.top, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
// Put the OK button where the Cancel button was
btnOK->SetWindowPos(NULL, RectCancel.left, RectCancel.top, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
return bResult;
}
- We will enable the Apply button when any control on the property pages changes
value.
Display the IDD_QUADRILATERAL dialog box and double-click the Side edit
control. If you are using MSVC 6, accept the suggest Member Function Name and
click OK. Implement the event as follows:
void CQuadrilateral::OnEnChangeEdtSside()
{
// TODO: Add your control notification handler code here
SetModified();
}
- Display the IDD_G3D dialog box and double-click the Side edit box. If you are
using MSVC 6, accept the suggest Member Function Name and click OK
void CGeome3D:: OnEnChangeEdtUside()
{
// TODO: Add your control notification handler code here
SetModified();
}
- Test the application and return to MSVC
- Using either MFC AppWizard (exe)(MSVC 6) or MFC Application (MSVC 7),
create a new application named Associates - Create it as a Single Document without Printing And Print Preview
- Change the design of the IDR_MAINFRAME as follows:
- Access the CMainFrame::PreCreateWindow() event and, to remove the Untitled
word from the title bar, type the following:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying