96 Star 154 Fork 68

葡萄城 / ActiveReports

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Splasher.cs 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
葡萄城控件 提交于 2014-09-17 14:54 . add SplashForm
using System;
using System.Threading;
using System.Windows.Forms;
namespace AppLoadingMT
{
public class Splasher
{
static SplashForm MySplashForm = null;
static Thread MySplashThread = null;
// internally used as a thread function - showing the form and
// starting the messageloop for it
static void ShowThread()
{
MySplashForm = new SplashForm();
Application.Run(MySplashForm);
}
// public Method to show the SplashForm
static public void Show()
{
if (MySplashThread != null)
return;
MySplashThread = new Thread(new ThreadStart(Splasher.ShowThread));
MySplashThread.IsBackground = true;
MySplashThread.ApartmentState = ApartmentState.STA;
MySplashThread.Start();
}
// public Method to hide the SplashForm
static public void Close()
{
if (MySplashThread == null) return;
if (MySplashForm == null) return;
try
{
MySplashForm.Invoke(new MethodInvoker(MySplashForm.Close));
}
catch (Exception)
{
}
MySplashThread = null;
MySplashForm = null;
}
// public Method to set or get the loading Status
static public string Status
{
set
{
if (MySplashForm == null)
{
return;
}
MySplashForm.StatusInfo = value;
}
get
{
if (MySplashForm == null)
{
throw new InvalidOperationException("Splash Form not on screen");
}
return MySplashForm.StatusInfo;
}
}
}
}
C#
1
https://gitee.com/GrapeCity/ActiveReports.git
git@gitee.com:GrapeCity/ActiveReports.git
GrapeCity
ActiveReports
ActiveReports
master

搜索帮助