public ComboxSex() { try { this.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.FormattingEnabled = true; this.Items.AddRange(new object[] { "男", "女" }); //label = new System.Windows.Forms.Label(); //label.Text = "性別"; //this.Controls.Add (label); this.TextChanged += new EventHandler(ComboxSex_TextChanged); } catch (Exception ex) { throw ex; } } 當(dāng)在窗體 畫此控件的時(shí)候。 this.comboxSex1 = new WindowsControlLibrary2.ComboxSex(); this.SuspendLayout(); // // comboxSex1 // this.comboxSex1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboxSex1.FormattingEnabled = true; this.comboxSex1.Items.AddRange(new object[] { "男", "女"}); new 的時(shí)候執(zhí)行了一次。 為什么會(huì)出紅色的代碼。如何取消。
- 2 回答
- 0 關(guān)注
- 379 瀏覽
添加回答
舉報(bào)
0/150
提交
取消