打印

[NET精华教程] .net教程:原创nutsbell系列---winform如何做启动页面

.net教程:原创nutsbell系列---winform如何做启动页面

winform如何做启动页面
启动页面 form2.cs
form中加一个picturebox1 一个label1
picturebox1用来显示软件图象
label1用来显示提示信息

主页面 form1.cs
在form1中page_load 事件中
  private void form1_load(object sender, system.eventargs e)

  {
   form2 ff=new form2();
   //开封面
   ff.show();
   //填充数据库名
   ff.label1.text="填充数据库名......";
   //关键地点否则form2上的label1无法刷新
   //且每次更新label1时都需要
   application.doevents();      

   sqlad_databases.fill(dataset11);
   foreach (datarow myrow  in dataset11.tables["databases"].rows)
   {
    databasename.items.add(myrow["catalog_name"].tostring());
   }
   
   //填充表信息
   ff.label1.text="填充表信息......";

   application.doevents();
   filltableinfo();
   datagrid1.datasource=dataset11.tables["tables"];
            
   //填充字段信息
   ff.label1.text="填充字段信息......";
   fillfiledinfo(dataset11.tables["tables"].rows[datagrid1.currentrowindex]["table_name"].tostring());
   datagrid2.datasource=dataset11.tables["columns"];
            
   //加载模板
   ff.label1.text="加载模板......";
   application.doevents();

   sourcebox.loadfile(@".\templet\default.txt",richtextboxstreamtype.plaintext);
   
   //填充模板目录
   ff.label1.text="填充模板目录......";
   application.doevents();

   directoryinfo cd= new directoryinfo(@".\templet\");
   foreach (fileinfo f in cd.getfiles())
   {
    templetfiles.items.add(f.name);
   }
   templetfiles.text="default.txt";
   //tt
   sqldataadapter4.fill(dataset11);
   sqldataadapter3.fill(dataset11);
  
   //关闭启动窗口
   ff.label1.text="完成.";
   application.doevents();
   //关封面
   ff.close();
  }





TOP

返回顶部
AYBlue

Processed in 0.059544 second(s), 7 queries.

当前时区 GMT+8, 现在时间是 2009-1-8 15:36 京ICP备06054220号

清除 Cookies - 联系我们 - 163K.com - Archiver - WAP