There is UserControl
uc1 and uc2, both are inside the other control. It is necessary to reproduce uc2.Enabled = true;
while the controls to each other are "brothers" with a common "parent".
Note: No delegates and events desirable.
The problem was solved as follows, if delegates and events are not used. A class was created, where individual global variables were entered under the necessary controls, which were to be accessed from the share controls.
class C { public static uc1 ucc1; public static uc2 ucc2; public static uc3 ucc3; }
Then in the necessary controls records were created in these variables.
public uc1() { InitializeComponent(); C.ucc1 = this; }
After that, this control can be accessed from anywhere by C.ucc1
.
Source: https://ru.stackoverflow.com/questions/507020/
All Articles
Binding
, probably, there are analogues under WinForms.) - VladD