How to transfer data between the two dialog boxes

Source: Internet
Author: User

For a small project, we encountered the problem of transferring data between two dialog boxes. Because we haven't used all of them for a long time, we found the solution after checking them for a long time. Here, we will summarize the content for your reference;

My requirement is to click a button in dlg1 to generate the dlg2 dialog box and use the value of the variable in dlg1 in dlg2

Solution: Execute dlg2.domodal () in the button response function; assign the value of dlg1 directly to the variable of dlg2. The reference code is as follows:

Cinfo DLG; DLG. Path = This-> path; DLG. num = This-> Number; DLG. domodal ();

Cinfo is what I call dlg2, and the Code itself is in the button response function of dlg1;

Of course, in addition to this method, I also know that global variables are defined directly in the app class, and messages are used to transmit data in various dialog boxes. However, this method is not quite useful, so some great gods know that they can communicate with each other.

 

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.