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 ...
随机推荐
- Balance(Stack)
栈的运用 mooc视频连接 #include <iostream> using namespace std; ]; ; void Push(char c) { ) { Top = ; S[ ...
- 公司拷贝回家的工程用sts导入clean package报错java.lang.NoClassDefFoundError
从公司拷贝工程回家加班,用相同版本的sts和jdk但是run as maven build clean package 总是报错java.lang.NoClassDefFoundError: ...
- js原形链
基本规则 1.每个对象都具有一个名为__proto__的属性: 2.每个构造函数(构造函数标准为大写开头,如Function(),Object()等等JS中自带的构造函数,以及自己创建的)都具有一个名 ...
- WinForm 修改App.config不起作用(但是调试没有异常)
修改Bin下的.exe.config文件,就能达到效果了. appconfig的修改,会保留在项目中,似乎不会实时地更改到.exe.config中..
- Dubbo基础配置
服务启动检查配置 默认check=true dubbo:reference check=“false” 关闭某个服务的启动时检查:(没有提供者时报错) dubbo:consumer check=“ ...
- javascript的代码块
a block of code 注意到这个问题是在看书的时候,中文版中出现“代码片段”这样的词语,于是就去翻看了英文版的原书.书中的用了a block of code,难道不应该翻译成代码块吗?(作为 ...
- 浏览器端 禁止 html 使用后退 或者替换后退功能..
知乎大佬的代码: 作者:独夜行 链接:https://www.zhihu.com/question/40511430/answer/166467343 来源:知乎 著作权归作者所有.商业转载请联系作者 ...
- HDU_6298 Maximum Multiple 【找规律】
一.题目 Given an integer $n$, Chiaki would like to find three positive integers $x$, $y$ and $z$ such t ...
- UVALive - 2678 二分/尺取
题意:求最小的长度L满足该长度上的元素和大于等于S 最近dp做多了总有一种能用dp解决一切的错觉 二分长度解决 #include<iostream> #include<algorit ...
- 我所理解的session_set_save_handler的执行顺序机制
默认的session handler启动顺序 <?php ini_set('session.gc_maxlifetime',10); ini_set('session.gc_probabilit ...