悬赏园豆:20
[已解决问题]
解决于 2008-09-05 23:38
public ComboxSex() <BR> { <BR> try <BR> { <BR> this.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; <BR> this.FormattingEnabled = true; <BR> this.Items.AddRange(new object[] { "男", "女" }); <BR> //label = new System.Windows.Forms.Label(); <BR> //label.Text = "性别"; <BR> //this.Controls.Add (label); <BR><BR> this.TextChanged += new EventHandler(ComboxSex_TextChanged); <BR> } <BR> catch (Exception ex) <BR> { <BR> throw ex; <BR> } <BR> } <BR><BR><BR>当在窗体 画此控件的时候。 <BR> this.comboxSex1 = new WindowsControlLibrary2.ComboxSex(); <BR> this.SuspendLayout(); <BR> // <BR> // comboxSex1 <BR> // <BR> <SPAN style="COLOR: #ff0000">this.comboxSex1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; <BR> this.comboxSex1.FormattingEnabled = true; <BR> this.comboxSex1.Items.AddRange(new object[] { <BR> "男", <BR> "女"});</SPAN> <BR>new 的时候执行了一次。 <BR>为什么会出红色的代码。如何取消。
秋色
|
初学一级
|
园豆:
47
提问于:2008-08-04 17:42