■ BarManager 클래스에서 바 관리자를 생성하는 방법을 보여준다.
▶ 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 |
using DevExpress.XtraEditors; using DevExpress.XtraBars; namespace TestProject { /// <summary> /// 메인 폼 /// </summary> public partial class MainForm : XtraForm { //////////////////////////////////////////////////////////////////////////////////////////////////// Field ////////////////////////////////////////////////////////////////////////////////////////// Private #region Field /// <summary> /// 바 관리자 /// </summary> private BarManager barManager; #endregion //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainForm() /// <summary> /// 생성자 /// </summary> public MainForm() { InitializeComponent(); this.barManager = new BarManager(); this.barManager.Form = this; this.barManager.BeginUpdate(); Bar mainBar = new Bar(this.barManager, "메인 메뉴") { DockStyle = BarDockStyle.Top , DockRow = 0 }; Bar statusBar = new Bar(this.barManager, "상태바" ) { DockStyle = BarDockStyle.Bottom }; Bar fileBar = new Bar(this.barManager, "파일 툴바") { DockStyle = BarDockStyle.Top }; this.barManager.Bars.Add(mainBar ); this.barManager.Bars.Add(statusBar); this.barManager.Bars.Add(fileBar ); this.barManager.MainMenu = mainBar; this.barManager.StatusBar = statusBar; this.barManager.EndUpdate(); } #endregion } } |