|
Existing AForm, BForm, CForm three forms, A, B can call up C form
If used:
CForm frm = new CForm ();
frm.Owner = this;
frm.ShowDialog ();
In the C form, you can set the variables in A and B.
If used: AForm frm = (AForm) this.Owner;
frm.x = 100;
Or: BForm frm = (BForm) this.Owner;
frm.x = 100;
When the program is running, how does the CForm form know whether it is called AForm or BForm and return a value? |
|