C# как получить доступ к объектам формы друг друга
Below this code I'm trying to figure out how these forms can freely accessed their both objects. In these code, - ITEMCount can access the objects of SIMSProduct - On the other side although SIMSProduct can see the objects of ITEMCount (There is no argument given that corresponds to the required formal parameter 'view' of 'SIMSProduct.SIMSProduct(ITEMCount)')
Что я уже пробовал:
//Form that use SIMSPRODUCT controls public partial class ITEMCount : Form { SIMSProduct _view; public ITEMCount(SIMSProduct view) { InitializeComponent(); _view = view; DisplayQuantity(); } } // Form controls that been accessed by ITEMCOUNT public partial class SIMSProduct : UserControl { ITEMCount _view; public SIMSProduct(ITEMCount view) { InitializeComponent(); _view = view; } } //Code for calling the ITEMCount form new ITEMCount(this).ShowDialog(); // Belongs to SIMSProduct form //Code for calling the SIMSProduct form var obj = new SIMSProduct(); // this where error point out obj.Dock = DockStyle.Fill; panel3.Controls.Clear(); panel3.Controls.Add(obj);