■ NativeMdiView 클래스에서 다중 문서 인터페이스(MDI)를 사용하는 방법을 보여준다.
▶ 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 |
using System.Drawing; using DevExpress.XtraBars.Docking2010; using DevExpress.XtraBars.Docking2010.Views.NativeMdi; using DevExpress.XtraEditors; namespace TestProject { /// <summary> /// 메인 폼 /// </summary> public partial class MainForm : XtraForm { //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainForm() /// <summary> /// 생성자 /// </summary> public MainForm() { InitializeComponent(); DocumentManager documentManager = new DocumentManager(); documentManager.MdiParent = this; documentManager.View = new NativeMdiView(); for(int i = 0; i < 3; i++) { XtraForm childForm = new XtraForm(); childForm.MdiParent = this; childForm.Size = new Size(400, 300); childForm.Text = "자식 폼 " + (i + 1); SimpleButton button = new SimpleButton(); button.Parent = childForm; button.Location = new Point(10, 10); button.Size = new Size(100, 30); button.Text = "버튼 " + (i + 1); childForm.Show(); } } #endregion } } |