DevExpress 의 SplashScreen 사용법 실례
3533 단어 DevExpress
핵심 코드 부분 은 다음 과 같 습 니 다.
using DevExpress.XtraSplashScreen;
using System;
namespace DevExpressUtilHelpV3
{
/// <summary>
/// .NET 3.0 SplashScreen
/// </summary>
public static class SplashScreenToolV3
{
private const bool FadeIn = false;
private const bool FadeOut = true;
private const bool ThrowExceptionIfIsAlreadyShown = false;
private const bool ThrowExceptionIfIsAlreadyClosed = false;
/// <summary>
/// ShowSplashScreen
/// </summary>
/// <param name="type">WaitForm</param>
public static void ShowSplashScreen(Type type)
{
CloseSplashScreen();
SplashScreenManager.ShowForm(null, type, FadeIn, FadeOut, ThrowExceptionIfIsAlreadyShown);
}
/// <summary>
/// CloseSplashScreen
/// </summary>
public static void CloseSplashScreen()
{
if (SplashScreenManager.Default != null)
{
//Thread _task = new Thread(() =>
//{
SplashScreenManager.CloseForm(ThrowExceptionIfIsAlreadyClosed);
//});
//_task.Start();
}
}
/// <summary>
/// SetCaption
/// </summary>
/// <param name="caption"> Title</param>
public static void SetCaption(string caption)
{
if (SplashScreenManager.Default != null && !string.IsNullOrEmpty(caption))
{
SplashScreenManager.Default.SetWaitFormCaption(caption);
}
}
/// <summary>
/// SetDescription
/// </summary>
/// <param name="description"> </param>
public static void SetDescription(string description)
{
if (SplashScreenManager.Default != null && !string.IsNullOrEmpty(description))
{
SplashScreenManager.Default.SetWaitFormDescription(description);
}
}
}
}
테스트 코드 는 다음 과 같 습 니 다:
try
{
SplashScreenToolV3.ShowSplashScreen(typeof(WaitForm1));
Thread.Sleep(5000);
throw new Exception("ccccccccc");
////Thread.Sleep(5000);
//SplashScreenToolV3.SetCaption(" ....");
////SplashScreenController.ShowSplashScreen();
//Thread _task1 = new Thread(() =>
//{
// for (int i = 0; i < 100; i++)
// {
// SplashScreenToolV3.SetDescription(i.ToString() + "%");
// Thread.Sleep(1000);
// }
//});
//Thread _task2 = new Thread(() =>
//{
// for (int i = 0; i < 100; i++)
// {
// SplashScreenToolV3.SetCaption(" .." + i);
// Thread.Sleep(500);
// }
//});
//_task1.Start();
//_task2.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
// SplashScreenController.HideSplashScreen();
}
테스트 효 과 는 다음 그림 과 같다.본 고 에서 말 한 방법 이 타격 의 C\#프로 그래 밍 에 도움 이 되 기 를 바 랍 니 다!
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
DevExpress GridControl 데이터 바인딩본인은 재주가 없군요. 두 시간 넘게 고생해서야 데이터를 연결했습니다.이제 더 많은 친구들을 돕기 위해 고생 과정을 기록해 두고, 자신도 복습해 보자. 코드로 바로 올라갔네... WPF 하 xaml 파일 이상 주의:...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.