VC++ Programming UESTC Chapter 6 The Modal Dialog and windows common Controls What does modal dialog means? How to use control palette to add controls to your dialog window? Understand the domodal and dodata Exchange e How to add dialog control at runtime? o What are the windows common control and how to program with them
VC++ Programming @ UESTC 1 Chapter 6 The Modal Dialog and Windows Common Controls ⚫ What does modal dialog means? ⚫ How to use control palette to add controls to your dialog window? ⚫ Understand the DoModal() and DoDataExchange() ⚫ How to add dialog control at runtime? ⚫ What are the windows common control and how to program with them
VC++ Programming UESTC Chapter 6 The Modal Dialog and windows common Controls e Almost every Windows-based program uses a dialog to interact with the user e There re two kinds of dialogs: Modal and modeless With a modal dialog, the user cannot work elsewhere in the same application( more correctly the same user interface thread) until the dialog is closed o With modeless dialog, the user can work in another window while the dialog is on the screen
VC++ Programming @ UESTC 2 ⚫ Almost every Windows-based program uses a dialog to interact with the user. ⚫ There’re two kinds of dialogs: Modal and Modeless. ⚫ With a modal dialog, the user cannot work elsewhere in the same application (more correctly the same user interface thread) until the dialog is closed. ⚫ With modeless dialog, the user can work in another window while the dialog is on the screen. Chapter 6 The Modal Dialog and Windows Common Controls
VC++ Programming@UESTC Chapter 6 The Modal Dialog and windows common Controls o a dialog window almost al ways tied to a windows resource that identifies the dialogs elements and specifies their ayout The elements on the dialog are called dialog controls, which include edit control. buttons. list boxes. combo boxes labels tree views, progress indicators, sliders and so forth Windows manages these controls using special grouping and tabbing logic The dialog controls can be referenced by the C Wnd pointer or by an index number 3
VC++ Programming @ UESTC 3 ⚫ A dialog window almost always tied to a Windows resource that identifies the dialog’s elements and specifies their layout. ⚫ The elements on the dialog are called dialog controls, which include edit control, buttons, list boxes, combo boxes, labels, tree views, progress indicators, sliders and so forth. ⚫ Windows manages these controls using special grouping and tabbing logic. ⚫ The dialog controls can be referenced by the CWnd pointer or by an index number. Chapter 6 The Modal Dialog and Windows Common Controls
VC++ Programming UESTC Chapter 6 The Modal Dialog and windows common Controls Steps to add a modal dialog to an existing porject 1.Use the dialog editor to create a dialog resource that contains various control Use Class Wizard to create a dialog class that is derived from Cdialog and attached to the resource created in stepl 3. Use Class Wizard to add data member, exchange functions and validation functions to the dialog class 4. Use Class Wizard to add message handler
VC++ Programming @ UESTC 4 ⚫ Steps to add a modal dialog to an existing porject: 1. Use the dialog editor to create a dialog resource that contains various controls. 2. Use ClassWizard to create a dialog class that is derived from Cdialog and attached to the resource created in step1. 3. Use ClassWizard to add data member, exchange functions and validation functions to the dialog class. 4. Use ClassWizard to add message handler. Chapter 6 The Modal Dialog and Windows Common Controls
VC++ Programming UESTC Chapter 6 The Modal Dialog and windows common Controls
VC++ Programming @ UESTC 5 Chapter 6 The Modal Dialog and Windows Common Controls