Windows programming Progressive--Use of list controls

Source: Internet
Author: User

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:

    • Periodic summary:

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.