private void TcIco_SelectedIndexChanged(object sender, EventArgs e) { if (TcIco.SelectedTab == null || TcIco.SelectedTab == TpIco0) { _IIco = null; return; } if (TcIco.SelectedTab.Controls.Count > 0) { _IIco = TcIco.SelectedTab.Controls[0] as IIco; } }
private void AddTab(string msg, SingleIcon ico) { _TpCnt += 1; TabPage page = new TabPage(); page.TabIndex = _TpCnt; page.Text = msg; //page.UseVisualStyleBackColor = true; TcIco.TabPages.Add(page); IcoEditor editor = new IcoEditor(this); editor.InitOnce(); editor.Dock = DockStyle.Fill; editor.SingleIcon = ico; page.Controls.Add(editor); TcIco.SelectedTab = page; _IIco = editor; }