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 |