/// <summary>
/// 启动画面
/// </summary>
public partial class SplashScreen : Form
{
/// <summary>
/// 启动画面本身
/// </summary>
static SplashScreen instance;
/// <summary>
/// 显示的图片
/// </summary>
Bitmap bitmap;
public static SplashScreen Instance
{
get
{
return instance;
}
set
{
instance = value;
}
}
public SplashScreen()
{
InitializeComponent();
// 设置窗体的类型
const string showInfo = "启动画面:我们正在努力的加载程序,请稍后...";
FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterScreen;
ShowInTaskbar = false;
bitmap = new Bitmap(Properties.Resources.SplashScreen);
ClientSize = bitmap.Size;
using (Font font = new Font("Consoles", 10))
{
using (Graphics g = Graphics.FromImage(bitmap))
{
g.DrawString(showInfo, font, Brushes.White, 130, 100);
}
}
BackgroundImage = bitmap;
}
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
if (bitmap != null)
{
bitmap.Dispose();
bitmap = null;
}
components.Dispose();
}
base.Dispose(disposing);
}
public static void ShowSplashScreen()
{
instance = new SplashScreen();
instance.Show();
}
}
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// 启动
SplashScreen.ShowSplashScreen();
// 进行自己的操作:加载组件,加载文件等等
// 示例代码为休眠一会
System.Threading.Thread.Sleep(3000);
// 关闭
if (SplashScreen.Instance != null)
{
SplashScreen.Instance.BeginInvoke(new MethodInvoker(SplashScreen.Instance.Dispose));
SplashScreen.Instance = null;
}
Application.Run(new FormMain());
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有