c# winform 欢迎界面时加载数据
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading; namespace WindowsFormsApplication1
{
public partial class WelcomeForm : Form
{
public WelcomeForm()
{
InitializeComponent();
} private void WelcomeForm_Load(object sender, EventArgs e)
{
//Thread.Sleep(2000);
//this.Close();
//this.Dispose();
} public void KillMe(object o, EventArgs e)
{
this.Close();
} /// <summary>
/// 加载并显示主窗体
/// </summary>
/// <param name="form">主窗体</param>
public static void LoadAndRun(Form form)
{
//订阅主窗体的句柄创建事件
form.HandleCreated += delegate
{
//启动新线程来显示Splash窗体
new Thread(new ThreadStart(delegate
{
WelcomeForm splash = new WelcomeForm();
//订阅主窗体的Shown事件
form.Shown += delegate
{
//通知Splash窗体关闭自身
splash.Invoke(new EventHandler(splash.KillMe));
splash.Dispose();
};
// Thread.Sleep(2000);
//显示Splash窗体
Application.Run(splash);
})).Start();
};
//显示主窗体
Application.Run(form);
} }
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading; namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
//Thread.Sleep(2000);
for (int i = ; i < ; i++)
{
Thread.Sleep();
}
//this.Focus();
MessageBox.Show("加载完毕!");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading; namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); WelcomeForm.LoadAndRun(new Form1());
}
}
}
c# winform 欢迎界面时加载数据的更多相关文章
- SpringMvc 系统启动时加载数据到内存中
SpringMvc 系统启动时加载数据到内存中 学习了:http://blog.csdn.net/newstruts/article/details/18668269 https://www.cnbl ...
- Tomcat启动时加载数据到缓存---web.xml中listener加载顺序(优先初始化Spring IOC容器)
JavaWebSpringTomcatCache 最近用到在Tomcat服务器启动时自动加载数据到缓存,这就需要创建一个自定义的缓存监听器并实现ServletContextListener接口,并且 ...
- js 窗口滚动到一定高度时加载数据
<script type="text/javascript"> //当窗口滚动到一定高度时 某块页面开始加载数据 window.onload = function() ...
- Tomcat启动时加载数据到缓存---web.xml中listener加载顺序(例如顺序:1、初始化spring容器,2、初始化线程池,3、加载业务代码,将数据库中数据加载到内存中)
最近公司要做功能迁移,原来的后台使用的Netty,现在要迁移到在uap上,也就是说所有后台的代码不能通过netty写的加载顺序加载了. 问题就来了,怎样让迁移到tomcat的代码按照原来的加载顺序进行 ...
- 时间序列数据库——索引用ES、聚合分析时加载数据用什么?docvalues的列存储貌似更优优势一些
加载 如何利用索引和主存储,是一种两难的选择. 选择不使用索引,只使用主存储:除非查询的字段就是主存储的排序字段,否则就需要顺序扫描整个主存储. 选择使用索引,然后用找到的row id去主存储加载数据 ...
- 五、angularjs在进入界面前加载数据
有时候我们需要在页面加载前就要绑定数据,比如有的图片太多就会导致在加载的过程中很慢,或者title是动态的,通过从后台取数据来改变,如果进入页面后在读取数据会导致以页面刷新数据太慢,这样就需要我们在进 ...
- vue使用H5实现滚动到页面底部时加载数据
使用原生vue实现瀑布流,发现无法实现小程序那种滚动到地步触发加载效果,只能自己研究了 实现效果: 实现代码: 首先添加监听滚动事件 mounted() { window.addEventListen ...
- Spring启动时加载数据
程序中也许有会有许多常用的,不会经常更改的数据,我们可以在程序初始化的时候就把他们加载,就不用频繁的加载或者查询. 以下是几个常用的,有COPY收集的,也有自己弄. 1. 实现BeanPostProc ...
- WinForm ListView虚拟模式加载数据 提高加载速度
将VirtualMode 属性设置为 true 会将 ListView 置于虚拟模式.控件不再使用Collection.Add()这种方式来添加数据,取而代之的是使用RetrieveVirtualIt ...
随机推荐
- spring boot项目分享
Spring boot项目分享 以下项目是我自己做的一些练习项目,有兴趣的小伙伴可以下载下来看下 1.员工管理系统 下载地址:我的github 后续会继续补充
- ubuntu 16.4安装toolsbelt heroku
https://devcenter.heroku.com/articles/getting-started-with-python#set-up # Run this from your termin ...
- 洛谷P2510 [HAOI2008]下落的圆盘(计算几何)
题面 传送门 题解 对于每个圆,我们单独计算它被覆盖的周长是多少 只有相交的情况需要考虑,我们需要知道相交的那段圆弧的角度,发现其中一个交点和两个圆的圆心可以构成一个三角形且三边都已经知道了,那么我们 ...
- Python如何在子类里扩展父类的property?
<python cookbook>8.8节讨论子类扩展property时,一开始都晕了,思考了半天才勉强弄懂一点,赶快记下来.废话不多说,先上代码: class Person: def _ ...
- HTTP上下文表单内容转为实体对象
using ServiceStack.Web; using System; using System.Collections.Generic; using System.Linq; using Sys ...
- Android 滚动视图(ScollView)
1.介绍 2.使用技巧 3.xml文件代码 <?xml version="1.0" encoding="utf-8"?> <LinearLay ...
- C# .Net正则表达式去除HTML标记和空格
C# .Net正则表达式去除HTML标记和空格 http://www.cnblogs.com/deerchao/archive/2006/08/24/zhengzhe30fengzhongjiaoch ...
- ElementUI 时间控件
<template> <div class="block"> <span class="demonstration">默认& ...
- AES/CBC/PKCS5Padding对称加密
package unit; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.cry ...
- 人生苦短,我用pycharm
一.安装 1.首先到官网上下载正版,然后点击安装,只需要更改下面一个地方即可 2.激活码或者帐号的话,可以去百度搜,也可以去某宝买,也就3块钱(一年),不建议使用破解版,如果你真的差这三块钱的话,你还 ...