/// <summary> /// イベントページ複製 /// </summary> private void btnPageCopy_Click(object sender, EventArgs e) { if (this.tbcEVPages.TabCount >= Map.MaxEVPageCount) { MessageBox.Show("イベントページの限界数に達しています。", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var ctlPage = new CtrlComponent.Map.ctlEVPage(); ctlPage.SetEVPageData(((CtrlComponent.Map.ctlEVPage) this.tbcEVPages.SelectedTab.Controls[0]).GetEVPageData().Clone() as EVData.EventOnePage); this.tbcEVPages.TabPages.Add($"ページ {this.tbcEVPages.TabCount + 1}"); this.tbcEVPages.TabPages[this.tbcEVPages.TabCount - 1].Controls.Add(ctlPage); ctlPage.Dock = DockStyle.Fill; this.tbcEVPages.SelectedIndex = this.tbcEVPages.TabCount - 1; }
/// <summary> /// 画面上のイベントページを追加します。 /// これに合わせて内部データ上のページも追加して下さい。 /// 返値は成功したかどうかを示します。 /// </summary> private bool addPage() { if (this.tbcEVPages.TabCount >= Map.MaxEVPageCount) { MessageBox.Show("イベントページの限界数に達しています。", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } var ctlPage = new CtrlComponent.Map.ctlEVPage(); this.tbcEVPages.TabPages.Add($"ページ {this.tbcEVPages.TabCount + 1}"); this.tbcEVPages.TabPages[this.tbcEVPages.TabCount - 1].Controls.Add(ctlPage); ctlPage.Dock = DockStyle.Fill; this.tbcEVPages.SelectedIndex = this.tbcEVPages.TabCount - 1; return(true); }