Transfer parameters between forms

xiaoxiao2021-03-05  26

Sometimes it might want to pass parameters between individual forms, there are two ways to achieve:

1. In the MDI form, to reference the data in the parent form between the child form, with the following methods:

FormParent fm_parent = (formparent) this.

Mdiparent;

Description: FormParent is the name of the parent form

2. In the case where a form is popped up from the main form, it is available.

Owner method

Formmain frm_owner = (formmain) this.owner;

Description: FormMain is a main form, the current form is called by the main window, and when the main form is set at the main form, the main form is set.

转载请注明原文地址:https://www.9cbs.com/read-37225.html

New Post(0)