Add the list Ctrl and set the View property to report, and the final page is designed as follows:
To add a variable to Listctrl:
We define a function in which the contents of the function are specifically used to initialize the list box, first to take a step:
and add this member function in the dialog header file:
and add this function in the initialization code:
After running it has the effect:
Insert a certain amount of data, the code is as follows:
The following code is run:
Now let's insert a dialog with the following layout:
Add a class to this dialog, and with the dialog class, you can add the message response function of other controls to this class as the dialog member function:
The following adds the code to the first dialog add:
The message response function code for the deleted button is as follows:
Let's do it now.
These several functions. Add a variable to the second dialog edit box first:
Add a Change event to the four edit boxes:
The following four functions correspond to the following code:
The following is a message response that writes the second dialog Add button:
Run:
Add to:
MFC initially established a dialog, just add the corresponding control inside, corresponding to the corresponding message response function, variables, events and so on. These are the member variables or the member functions of this dialog;
You can also add dialog, sheet, and so on to this dialog. Thus, if you add a control to a new dialog to implement functions such as message response functions, events, and so on, the new dialog must have a class to hold these functions as member functions of the class, so first add classes to the new dialog and then implement those functions. These controls are on the new dialog, so their functions are member functions of the new dialog class.
:
Windows programming Progressive--Use of list controls