示例#1
0
        private void XtraForm1_Load(object sender, EventArgs e)
        {
            BarManager barManager = new BarManager();

            barManager.Form = this;
            // Create a bar with a New button.
            barManager.BeginUpdate();
            Bar bar = new Bar(barManager, "My Bar");

            bar.DockStyle       = BarDockStyle.Top;
            barManager.MainMenu = bar;
            BarItem barItem = new BarButtonItem(barManager, "New");

            barItem.ItemClick += new ItemClickEventHandler(barItem_ItemClick);
            bar.ItemLinks.Add(barItem);
            barManager.EndUpdate();
            // Create an XtraTabbedMdiManager that will manage MDI child windows.
            mdiManager            = new XtraTabbedMdiManager(components);
            mdiManager.MdiParent  = this;
            mdiManager.PageAdded += MdiManager_PageAdded;

            XtraForm2 f = new XtraForm2();

            f.Text      = "Child Form " + (++ctr).ToString();
            f.MdiParent = this;
            f.Show();
        }
示例#2
0
        void barItem_ItemClick(object sender, ItemClickEventArgs e)
        {
            // Create an MDI child form.
            XtraForm2 f = new XtraForm2();

            f.Text      = "Child Form " + (++ctr).ToString();
            f.MdiParent = this;
            f.Show();
        }