[DEVEXPRESS/WINFORM] SplashScreenManager 클래스 : ShowOverlayForm 정적 메소드를 사용해 오버레임 폼 표시하기
DevExpress/WinForm 2019. 5. 5. 23:29■ SplashScreenManager 클래스 : ShowOverlayForm 정적 메소드를 사용해 오버레임 폼 표시하기
------------------------------------------------------------------------------------------------------------------------
▶ MainForm.cs
using System; using System.Drawing;
using DevExpress.XtraEditors; using DevExpress.XtraSplashScreen;
namespace TestProject { /// <summary> /// 메인 폼 /// </summary> public partial class MainForm : XtraForm { //////////////////////////////////////////////////////////////////////////////////////////////////// Field ////////////////////////////////////////////////////////////////////////////////////////// Private
#region Field
/// <summary> /// 옵션 /// </summary> private OverlayWindowOptions options = null;
/// <summary> /// 핸들 /// </summary> private IOverlaySplashScreenHandle handle = null;
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainForm()
/// <summary> /// 생성자 /// </summary> public MainForm() { InitializeComponent();
this.applyButton.Enabled = true; this.cancelButton.Enabled = false;
this.options = new OverlayWindowOptions(true, true, Color.White, Color.Black, 0.5, Image.FromFile("earth.gif"));
#region 이벤트를 설정한다.
this.applyButton.Click += applyButton_Click; this.cancelButton.Click += cancelButton_Click;
#endregion }
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method ////////////////////////////////////////////////////////////////////////////////////////// Private
#region 적용 버튼 클릭시 처리하기 - applyButton_Click(sender, e)
/// <summary> /// 적용 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void applyButton_Click(object sender, EventArgs e) { this.applyButton.Enabled = false;
this.handle = SplashScreenManager.ShowOverlayForm(this.pictureEdit, this.options);
this.cancelButton.Enabled = true; }
#endregion #region 취소 버튼 클릭시 처리하기 - cancelButton_Click(sender, e)
/// <summary> /// 취소 버튼 클릭시 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void cancelButton_Click(object sender, EventArgs e) { this.cancelButton.Enabled = false;
if(this.handle != null) { SplashScreenManager.CloseOverlayForm(this.handle); }
this.applyButton.Enabled = true; }
#endregion } }
|
------------------------------------------------------------------------------------------------------------------------
댓글을 달아 주세요