In MFC, we often need to map some variables to the control!

Source: Internet
Author: User

The use of control variables in MFC!
In MFC, we often need to map some variables to the control!

1. The control corresponds to the value variable.


Use updatedate to call dodataexchange (cdataexchange * PDX) to exchange variable information!

For example:
Ddx_text (PDX, idc_staticcount, m_scount); --> Value

Match the Control ID idc_staticcount with the m_scount variable,

Use updatedate (true) to write the idc_staticcount control data to m_scount;

Use updatedate (false) to read and write m_scount data to the idc_staticcount control;


2. The control corresponds to the control variable.
Ddx_control (PDX, idc_bstarttime, m_cstarttime); --> Control

The control with the ID of idc_bstarttime corresponds to the m_scount variable, such as button.

Now we can change the status of the corresponding control through the m_cstarttime control variable!

M_cstarttime.enablewindow (false); you can change whether the control is available! If no control corresponds,

Then we can use the equivalent statement: getdlgitem (idc_bstarttime)-> enablewindow (true); from: http://hi.baidu.com/tanglewish/blog/item/6c89d982abdbd8bb6c8119bb.html

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.