Bind member variables of different types in the dialog box Control

Source: Internet
Author: User

Bind member variables of different types in the dialog box control:
DDX: Dialog Data Exchange Dialog box Data Exchange
DDV: Data validation in the Dialog Data Validate Dialog box
A control can bind multiple variables of different types;
①. Two Methods for binding control type variables-data exchange mechanism:
◆ Use the GetDlgItem function;
CButton * cButton;
CButton = (CButton *) GetDlgItem (IDC_BUTTON1 );
// Use the variable disable button
CButton-> EnableWindow (FALSE );
◆ Use the VC Wizard to bind the generated code and how to manually add it;



② Binding of string type and numeric type variables and data verification mechanism;
String type-the length can be limited;
// Bind the variable
DDX_Text (pDX, IDC_EDIT1, bu_str );
// Limit the length
DDV_MaxChars (pDX, bu_str, 5 );
Value Type-you can limit the size;
DDX_Text (pDX, IDC_EDIT1, num );
DDV_MinMaxInt (pDX, num, 0, 5 );
UpdateData (TRUE );
UpdateData (TRUE); // control flow variable;
UpdateData (FALSE); // variable flow control;
Share:

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.