日期:2014-05-17 浏览次数:20925 次
// listControl1 // this.listControl1.BackColor = System.Drawing.Color.Black; new ListControl.ItemCollection().Add(((ListItem)(resources.GetObject("listControl1.ItemsExtendList")))); new ListControl.ItemCollection().Add(((ListItem)(resources.GetObject("listControl1.ItemsExtendList1")))); this.listControl1.ItemsList = ((System.Collections.Generic.List<ListItem>)(resources.GetObject("listControl1.ItemsList"))); this.listControl1.Location = new System.Drawing.Point(97, 12); this.listControl1.Name = "listControl1"; this.listControl1.Size = new System.Drawing.Size(75, 23); this.listControl1.TabIndex = 0; this.listControl1.Text = "listControl1";
// listView1 // System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("11"); System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("12"); this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem1, listViewItem2}); this.listView1.Location = new System.Drawing.Point(66, 62); this.listView1.Name = "listView1"; this.listView1.Size = new System.Drawing.Size(121, 97); this.listView1.TabIndex = 1; this.listView1.UseCompatibleStateImageBehavior = false;
public void Add(ListItem item) { this.EnsureSpace(1); int index = this.IndexOf(item); if (index == -1) { this.m_arrItems[this.count++] = item; this.owner.Invalidate(); //重绘控件 } }
public List<ListItem> ItemsList { get { if (itemsList == null) itemsList = new List<ListItem>(); return itemsList; } set { itemsList = value; this.Invalidate(); } }