110,539
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript"><!--
google_ad_client = "pub-6801609417141055";
/* 728x90, 创建于 10-5-6 */
google_ad_slot = "7731452172";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
static void Main()
{
SkinManager.EnableMdiFormSkins();
SkinManager.EnableFormSkins();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
welcome wel = new welcome();
wel.Show();
context = new ApplicationContext();
context.Tag = wel;
Application.Idle += new EventHandler(Application_Idle); //注册程序运行空闲去执行主程序窗体相应初始化代码
Application.Run(context);
//WFMain main = XtraFormFactory.CreateMdiForm<WFMain>();
//Application.Run(main);
}
//初始化等待处理函数
private static void Application_Idle(object sender, EventArgs e)
{
Application.Idle -= new EventHandler(Application_Idle);
if (context.MainForm == null)
{
WFMain main = XtraFormFactory.CreateMdiForm<WFMain>();
context.MainForm = main;
main.init(); //主窗体要做的初始化事情在这里,该方法在主窗体里应该申明为public
welcome sp = (welcome)context.Tag;
sp.Close(); //关闭启动窗体
main.Show(); //启动主程序窗体
}
}