private void cboTextType_SelectedIndexChanged(object sender, EventArgs e) { if (this.m_CanDo) { this.tabControl1.TabPages.Clear(); if (this.cboTextType.SelectedIndex == 0) { this.m_pTextSymbol = new TextSymbolClass(); TextGeneralControl control = new TextGeneralControl(); MaskControl control2 = new MaskControl(); TabPage page = new TabPage("常规"); this.tabControl1.TabPages.Add(page); control.m_pTextSymbol = this.m_pTextSymbol; control2.m_pMask = this.m_pTextSymbol as IMask; control2.m_pSG = this.m_pSG; control.ValueChanged += new ValueChangedHandler(this.ValueChanged); control2.ValueChanged += new ValueChangedHandler(this.ValueChanged); control.Dock = DockStyle.Fill; control2.Dock = DockStyle.Fill; page.Controls.Add(control); page = new TabPage("掩模"); this.tabControl1.TabPages.Add(page); page.Controls.Add(control2); } this.symbolItem1.Symbol = this.m_pTextSymbol as ISymbol; this.symbolItem1.Invalidate(); } }
private void Init() { this.m_CanDo = false; this.cboTextType.SelectedIndex = 0; this.cboUnit.SelectedIndex = 0; this.cboScale.SelectedIndex = this.m_ScaleIndex; this.m_CanDo = true; this.tabControl1.TabPages.Clear(); if (this.cboTextType.SelectedIndex == 0) { TextGeneralControl control = new TextGeneralControl(); MaskControl control2 = new MaskControl(); TabPage page = new TabPage("常规"); this.tabControl1.TabPages.Add(page); control.m_pTextSymbol = this.m_pTextSymbol; control2.m_pMask = this.m_pTextSymbol as IMask; control2.m_pSG = this.m_pSG; control.ValueChanged += new ValueChangedHandler(this.ValueChanged); control2.ValueChanged += new ValueChangedHandler(this.ValueChanged); control.Dock = DockStyle.Fill; control2.Dock = DockStyle.Fill; page.Controls.Add(control); page = new TabPage("掩模"); this.tabControl1.TabPages.Add(page); page.Controls.Add(control2); } this.symbolItem1.Symbol = this.m_pTextSymbol as ISymbol; this.m_CanDo = true; }