我从c#中的主窗体加载用户控件,但加载时,用户控件的_load函数不会触发。
我的加载代码:
//MainPanel is the panel where all the userControls are loaded
MainPanel.Controls.Clear();
ucFLightInformations.Dock = DockStyle.Fill;
MainPanel.Controls.Add(ucFLightInformations); //Load method of this one works
MainPanel.Controls.Clear();
ucFlightMap.Dock = DockStyle.Fill;
MainPanel.Controls.Add(ucFlightMap); //Load method of this one doesn't work
MainPanel.Controls.Clear();
ucHome.Dock = DockStyle.Fill;
MainPanel.Controls.Add(ucHome); //Load method of this one works
谢谢!