■ WindowsUIView 클래스에서 모달 메시지 박스 플라이아웃(Flyout) 컨테이너를 사용하는 방법을 보여준다.
▶ MainForm.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
using System.Drawing; using System.Windows.Forms; using DevExpress.XtraBars.Docking2010; using DevExpress.XtraBars.Docking2010.Views.WindowsUI; using DevExpress.XtraEditors; namespace TestProject { /// <summary> /// 메인 폼 /// </summary> public partial class MainForm : XtraForm { //////////////////////////////////////////////////////////////////////////////////////////////////// Field ////////////////////////////////////////////////////////////////////////////////////////// Private #region Field /// <summary> /// 윈도우즈 UI 뷰 /// </summary> private WindowsUIView view; /// <summary> /// 플라이아웃 컨테이너 /// </summary> private Flyout flyout; #endregion //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainForm() /// <summary> /// 생성자 /// </summary> public MainForm() { InitializeComponent(); this.view = new WindowsUIView(); this.view.FlyoutProperties.Appearance.BackColor = Color.DodgerBlue; DocumentManager documentManager = new DocumentManager(); documentManager.ContainerControl = this; documentManager.View = this.view; FlyoutAction action = new FlyoutAction() { Caption = "CONFIRMATION", Description = "어플리케이션을 종료하시겠습니까?" }; action.Commands.Add(FlyoutCommand.OK ); action.Commands.Add(FlyoutCommand.Cancel); this.flyout = new Flyout(); this.flyout.Name = "flyout"; this.flyout.Action = action; FormClosing += Form_FormClosing; } #endregion //////////////////////////////////////////////////////////////////////////////////////////////////// Method ////////////////////////////////////////////////////////////////////////////////////////// Private #region 폼을 닫을 경우 처리하기 - Form_FormClosing(sender, e) /// <summary> /// 폼을 닫을 경우 처리하기 /// </summary> /// <param name="sender">이벤트 발생자</param> /// <param name="e">이벤트 인자</param> private void Form_FormClosing(object sender, FormClosingEventArgs e) { // 컨텐트 컨테이너 추가를 생성자에서 하면 플라이아웃 메시지 박스가 시작시 표시된다. this.view.ContentContainers.Add(this.flyout); if(this.view.ShowFlyoutDialog(this.flyout) != DialogResult.OK) { e.Cancel = true; } } #endregion } } |