_load事件不会触发c#

时间:2017-02-13 15:04:45

标签: c# events load

我从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

谢谢!

0 个答案:

没有答案