public static FormDishInfo CreateFormDishInfo() { if (_formDishInfo == null) { _formDishInfo = new FormDishInfo(); } return(_formDishInfo); }
private void TeaMenu_Click(object sender, EventArgs e) { TabPage tabPage = new TabPage(); tabPage.Text = "菜单管理"; tabPage.Name = "page3"; if (!IsInto(tabPage.Name)) { FormDishInfo page = new FormDishInfo(); //注册关闭事件 page.close += Close; page.Name = "formpage"; page.TopLevel = false; page.FormBorderStyle = FormBorderStyle.None; tabPage.Controls.Add(page); page.Show(); tabControl1.TabPages.Add(tabPage); } //选中该选项卡 this.tabControl1.SelectedTab = tabControl1.TabPages["page3"]; }
private void emnuDishInfo_Click(object sender, EventArgs e) { FormDishInfo formDishInfo = new FormDishInfo(); formDishInfo.ShowDialog(); }
private void menuDishInfo_Click(object sender, EventArgs e) { FormDishInfo fdi = FormDishInfo.CreateFormDishInfo(); fdi.ShowDialog(); }