你看这样行不public class CustomCheckListBox : UserControl
{
private CheckedListBox checkedListBox1;
private Panel panel1;
private Label label1;
public CustomCheckListBox()
{
InitializeComponent();
} private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
this.panel1 = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// checkedListBox1
//
this.checkedListBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.checkedListBox1.FormattingEnabled = true;
this.checkedListBox1.Location = new System.Drawing.Point(0, 19);
this.checkedListBox1.Name = "checkedListBox1";
this.checkedListBox1.Size = new System.Drawing.Size(150, 124);
this.checkedListBox1.TabIndex = 1;
//
// panel1
//
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(150, 19);
this.panel1.TabIndex = 2;
//
// CustomCheckListBox
//
this.Controls.Add(this.checkedListBox1);
this.Controls.Add(this.panel1);
this.Name = "CustomCheckListBox";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false); }
}
{
private CheckedListBox checkedListBox1;
private Panel panel1;
private Label label1;
public CustomCheckListBox()
{
InitializeComponent();
} private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
this.panel1 = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// checkedListBox1
//
this.checkedListBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.checkedListBox1.FormattingEnabled = true;
this.checkedListBox1.Location = new System.Drawing.Point(0, 19);
this.checkedListBox1.Name = "checkedListBox1";
this.checkedListBox1.Size = new System.Drawing.Size(150, 124);
this.checkedListBox1.TabIndex = 1;
//
// panel1
//
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(150, 19);
this.panel1.TabIndex = 2;
//
// CustomCheckListBox
//
this.Controls.Add(this.checkedListBox1);
this.Controls.Add(this.panel1);
this.Name = "CustomCheckListBox";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false); }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货