Last updated:
22. July 2001
(Start sub-menu)
User Interface Programming Column
Splitter Controls and Dialog Resizing
(End sub-menu)
// // Disabling and Re-enabling a Default Button: // BEGIN_MESSAGE_MAP(TestDialog, CDialog) //{{AFX_MSG_MAP(TestDialog) ON_EN_SETFOCUS(IDC_MULTILINE, OnSetfocusMultiline) ON_EN_KILLFOCUS(IDC_MULTILINE, OnKillfocusMultiline) //}}AFX_MSG_MAP END_MESSAGE_MAP() ////////////////////////////////////////////// // TestDialog message handlers // The member _defButton is of class CButton. void TestDialog::OnSetfocusMultiline() { SetDefID( 0 ); // sends DM_SETDEFID _defButton.SetButtonStyle( _defButton.GetButtonStyle() & ~BS_DEFPUSHBUTTON ); } void TestDialog::OnKillfocusMultiline() { SetDefID( IDC_OK ); // sends DM_SETDEFID _defButton.SetButtonStyle( _defButton.GetButtonStyle() | BS_DEFPUSHBUTTON ); } // end of file
(Start bottom menu)
Top •
Home
• Articles
• Book
• Resources
Windows Developer Magazine
• R&D Books
• CMP Books
Amazon.com
• Amazon.co.uk
• Contact Petter Hesselberg
(End bottom menu)