Visual C++ and MFC Fundamentals Chapter 15: Fundamental Controls
Circumference = Radius * 2 * PIValue;
Area = Radius * Radius * PIValue;
m_szCircleCircumference.Format("%.3f", Circumference);
m_szCircleArea.Format("%.3f", Area);
UpdateData(FALSE);
}
void CCircular::OnBnClickedBtnEcalc()
{
// TODO: Add your control notification handler code here
UpdateData();
double radius, Radius, Circumference, Area;
radius = atof(m_szEllipseradius);
Radius = atof(m_szEllipseRadius);
Circumference = (radius + Radius) * PIValue;
Area = radius * Radius * PIValue;
m_szEllipseCircumference.Format("%.3f", Circumference);
m_szEllipseArea.Format("%.3f", Area);
UpdateData(FALSE);
}
- Test the application by changing the values of the Circular property pages
- After using it, close the application and return to MSVC
14.2.8..Window’s Focus..................................................................................
A control is said to have focus if it is ready to receive input from the user. For example, if
a text control, such as an edit box, has focus and the user presses a character key, the
corresponding character would be displayed in the control.
Controls show different ways of having focus. For example, when an edit box has focus,
a caret is blinking in it:
When a button has focus, it displays a dotted rectangle around its caption:
There are two main ways a control receives focus: based on a user’s action or an explicit
request from you. To give focus to a control, the user usually presses Tab, which allows
navigating from one control to another. To programmatically give focus to a control, call
the CWnd::SetFocus() method.
CWnd* SetFocus( );