且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

仿listBox写了一个Control控件为item的列表集合

更新时间:2022-09-04 10:05:13

  仿listBox写了一个Control控件为item的列表集合,由于最近做个项目要用,微软提供的控件实现起来不行,但自己写了一个,效果如下:
仿listBox写了一个Control控件为item的列表集合
代码
仿listBox写了一个Control控件为item的列表集合
  1仿listBox写了一个Control控件为item的列表集合using System;
  2仿listBox写了一个Control控件为item的列表集合using System.Collections.Generic;
  3仿listBox写了一个Control控件为item的列表集合using System.ComponentModel;
  4仿listBox写了一个Control控件为item的列表集合using System.Data;
  5仿listBox写了一个Control控件为item的列表集合using System.Drawing;
  6仿listBox写了一个Control控件为item的列表集合using System.Text;
  7仿listBox写了一个Control控件为item的列表集合using System.Text.RegularExpressions;
  8仿listBox写了一个Control控件为item的列表集合using System.Windows.Forms;
  9仿listBox写了一个Control控件为item的列表集合
 10仿listBox写了一个Control控件为item的列表集合namespace SQLAnalysis
 11仿listBox写了一个Control控件为item的列表集合{
 12仿listBox写了一个Control控件为item的列表集合    public class MySelfControlList : Control
 13仿listBox写了一个Control控件为item的列表集合    {
 14仿listBox写了一个Control控件为item的列表集合        private System.Windows.Forms.ErrorProvider err;
 15仿listBox写了一个Control控件为item的列表集合        public MySelfControlList()
 16仿listBox写了一个Control控件为item的列表集合        {
 17仿listBox写了一个Control控件为item的列表集合            InitializeComponent();
 18仿listBox写了一个Control控件为item的列表集合            this.BackColor = Color.White;
 19仿listBox写了一个Control控件为item的列表集合            itemList = new ListItemColloction();  
 20仿listBox写了一个Control控件为item的列表集合            if (isNeedVaidate)
 21仿listBox写了一个Control控件为item的列表集合            {
 22仿listBox写了一个Control控件为item的列表集合                err = new ErrorProvider();
 23仿listBox写了一个Control控件为item的列表集合            }

 24仿listBox写了一个Control控件为item的列表集合        }

 25仿listBox写了一个Control控件为item的列表集合       
 26仿listBox写了一个Control控件为item的列表集合
 27仿listBox写了一个Control控件为item的列表集合        
 28仿listBox写了一个Control控件为item的列表集合       
 29仿listBox写了一个Control控件为item的列表集合        [Browsable(false)]
 30仿listBox写了一个Control控件为item的列表集合        public bool IsValidated
 31仿listBox写了一个Control控件为item的列表集合        {
 32仿listBox写了一个Control控件为item的列表集合            get
 33仿listBox写了一个Control控件为item的列表集合            {
 34仿listBox写了一个Control控件为item的列表集合                return List_Validating(); 
 35仿listBox写了一个Control控件为item的列表集合            }

 36仿listBox写了一个Control控件为item的列表集合        }

 37仿listBox写了一个Control控件为item的列表集合        [DefaultValue(typeof(Color), "White")]
 38仿listBox写了一个Control控件为item的列表集合        public override Color BackColor
 39仿listBox写了一个Control控件为item的列表集合        {
 40仿listBox写了一个Control控件为item的列表集合            get
 41仿listBox写了一个Control控件为item的列表集合            {
 42仿listBox写了一个Control控件为item的列表集合                return base.BackColor; 
 43仿listBox写了一个Control控件为item的列表集合            }

 44仿listBox写了一个Control控件为item的列表集合            set
 45仿listBox写了一个Control控件为item的列表集合            {
 46仿listBox写了一个Control控件为item的列表集合                base.BackColor = value;
 47仿listBox写了一个Control控件为item的列表集合            }

 48仿listBox写了一个Control控件为item的列表集合        }

 49仿listBox写了一个Control控件为item的列表集合        private ListItemColloction itemList;
 50仿listBox写了一个Control控件为item的列表集合        
 51仿listBox写了一个Control控件为item的列表集合       /// <summary>
 52仿listBox写了一个Control控件为item的列表集合       /// 不提供设计时绑定
 53仿listBox写了一个Control控件为item的列表集合       /// </summary>

 54仿listBox写了一个Control控件为item的列表集合        [Bindable(false), Browsable(false)]
 55仿listBox写了一个Control控件为item的列表集合        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
 56仿listBox写了一个Control控件为item的列表集合        public ListItemColloction Items
 57仿listBox写了一个Control控件为item的列表集合        {
 58仿listBox写了一个Control控件为item的列表集合            get
 59仿listBox写了一个Control控件为item的列表集合            {
 60仿listBox写了一个Control控件为item的列表集合                if (itemList == null)
 61仿listBox写了一个Control控件为item的列表集合                    itemList = new ListItemColloction();
 62仿listBox写了一个Control控件为item的列表集合                return itemList;
 63仿listBox写了一个Control控件为item的列表集合            }

 64仿listBox写了一个Control控件为item的列表集合            set
 65仿listBox写了一个Control控件为item的列表集合            {
 66仿listBox写了一个Control控件为item的列表集合                itemList = value;
 67仿listBox写了一个Control控件为item的列表集合            }

 68仿listBox写了一个Control控件为item的列表集合        }

 69仿listBox写了一个Control控件为item的列表集合        public int Count
 70仿listBox写了一个Control控件为item的列表集合        {
 71仿listBox写了一个Control控件为item的列表集合            get
 72仿listBox写了一个Control控件为item的列表集合            {
 73仿listBox写了一个Control控件为item的列表集合                return itemList.Count;
 74仿listBox写了一个Control控件为item的列表集合            }

 75仿listBox写了一个Control控件为item的列表集合        }

 76仿listBox写了一个Control控件为item的列表集合        public void RemoveAll()
 77仿listBox写了一个Control控件为item的列表集合        {
 78仿listBox写了一个Control控件为item的列表集合            forint i=this.itemList.Count -1;i>-1;i--)
 79仿listBox写了一个Control控件为item的列表集合            {
 80仿listBox写了一个Control控件为item的列表集合                Item item = itemList[i];
 81仿listBox写了一个Control控件为item的列表集合                item.ItemControl.Parent = null;
 82仿listBox写了一个Control控件为item的列表集合                itemList.Remove(item);
 83仿listBox写了一个Control控件为item的列表集合            }

 84仿listBox写了一个Control控件为item的列表集合            
 85仿listBox写了一个Control控件为item的列表集合        }

 86仿listBox写了一个Control控件为item的列表集合        public int AddItem(Item item)
 87仿listBox写了一个Control控件为item的列表集合        {
 88仿listBox写了一个Control控件为item的列表集合            itemList.Add(item);
 89仿listBox写了一个Control控件为item的列表集合            this.Refresh();
 90仿listBox写了一个Control控件为item的列表集合            return itemList.IndexOf(item);
 91仿listBox写了一个Control控件为item的列表集合        }

 92仿listBox写了一个Control控件为item的列表集合        public void InsertItem(int index, Item item)
 93仿listBox写了一个Control控件为item的列表集合        {
 94仿listBox写了一个Control控件为item的列表集合            itemList.Insert(index, item);
 95仿listBox写了一个Control控件为item的列表集合            this.Refresh();
 96仿listBox写了一个Control控件为item的列表集合
 97仿listBox写了一个Control控件为item的列表集合        }

 98仿listBox写了一个Control控件为item的列表集合        public void RemoveItem(Item item)
 99仿listBox写了一个Control控件为item的列表集合        {
100仿listBox写了一个Control控件为item的列表集合            item.ItemControl.Parent = null;
101仿listBox写了一个Control控件为item的列表集合            itemList.Remove(item);
102仿listBox写了一个Control控件为item的列表集合            this.Refresh();
103仿listBox写了一个Control控件为item的列表集合        }

104仿listBox写了一个Control控件为item的列表集合        public void RemoveItemAt(int index)
105仿listBox写了一个Control控件为item的列表集合        {
106仿listBox写了一个Control控件为item的列表集合            itemList[index].ItemControl.Parent = null;
107仿listBox写了一个Control控件为item的列表集合            itemList.RemoveAt(index);
108仿listBox写了一个Control控件为item的列表集合            this.Refresh();
109仿listBox写了一个Control控件为item的列表集合        }

110仿listBox写了一个Control控件为item的列表集合        private string emptyText;
111仿listBox写了一个Control控件为item的列表集合        public string EmptyText
112仿listBox写了一个Control控件为item的列表集合        {
113仿listBox写了一个Control控件为item的列表集合            get
114仿listBox写了一个Control控件为item的列表集合            {
115仿listBox写了一个Control控件为item的列表集合             return emptyText;
116仿listBox写了一个Control控件为item的列表集合            }

117仿listBox写了一个Control控件为item的列表集合            set
118仿listBox写了一个Control控件为item的列表集合            {
119仿listBox写了一个Control控件为item的列表集合             emptyText =value;
120仿listBox写了一个Control控件为item的列表集合            }

121仿listBox写了一个Control控件为item的列表集合        }

122仿listBox写了一个Control控件为item的列表集合        [Browsable(false)]
123仿listBox写了一个Control控件为item的列表集合        public override string Text
124仿listBox写了一个Control控件为item的列表集合        {
125仿listBox写了一个Control控件为item的列表集合            get
126仿listBox写了一个Control控件为item的列表集合            {
127仿listBox写了一个Control控件为item的列表集合                return base.Text;
128仿listBox写了一个Control控件为item的列表集合            }

129仿listBox写了一个Control控件为item的列表集合            set
130仿listBox写了一个Control控件为item的列表集合            {
131仿listBox写了一个Control控件为item的列表集合                base.Text = value;
132仿listBox写了一个Control控件为item的列表集合            }

133仿listBox写了一个Control控件为item的列表集合        }

134仿listBox写了一个Control控件为item的列表集合
135仿listBox写了一个Control控件为item的列表集合       
136仿listBox写了一个Control控件为item的列表集合
137仿listBox写了一个Control控件为item的列表集合        public string ItemText(int index)
138仿listBox写了一个Control控件为item的列表集合        {
139仿listBox写了一个Control控件为item的列表集合            return itemList[index].ItemControl.Text;
140仿listBox写了一个Control控件为item的列表集合        }

141仿listBox写了一个Control控件为item的列表集合
142仿listBox写了一个Control控件为item的列表集合        private ToolTip toolTip1;
143仿listBox写了一个Control控件为item的列表集合        private int itemHeight = 25;
144仿listBox写了一个Control控件为item的列表集合        public int ItemHeight
145仿listBox写了一个Control控件为item的列表集合        {
146仿listBox写了一个Control控件为item的列表集合            get
147仿listBox写了一个Control控件为item的列表集合            {
148仿listBox写了一个Control控件为item的列表集合                return itemHeight;
149仿listBox写了一个Control控件为item的列表集合            }

150仿listBox写了一个Control控件为item的列表集合
151仿listBox写了一个Control控件为item的列表集合            set
152仿listBox写了一个Control控件为item的列表集合            {
153仿listBox写了一个Control控件为item的列表集合                itemHeight = value;
154仿listBox写了一个Control控件为item的列表集合            }

155仿listBox写了一个Control控件为item的列表集合        }

156仿listBox写了一个Control控件为item的列表集合        /// <summary>
157仿listBox写了一个Control控件为item的列表集合        /// 重写Paint方法
158仿listBox写了一个Control控件为item的列表集合        /// </summary>
159仿listBox写了一个Control控件为item的列表集合        /// <param name="e"></param>

160仿listBox写了一个Control控件为item的列表集合        protected override void OnPaint(PaintEventArgs e)
161仿listBox写了一个Control控件为item的列表集合        {
162仿listBox写了一个Control控件为item的列表集合
163仿listBox写了一个Control控件为item的列表集合            this.Height = this.itemHeight * (itemList.Count + 1);
164仿listBox写了一个Control控件为item的列表集合            base.OnPaint(e);
165仿listBox写了一个Control控件为item的列表集合            if (itemList.Count == 0)
166仿listBox写了一个Control控件为item的列表集合            {
167仿listBox写了一个Control控件为item的列表集合                e.Graphics.DrawString(this.emptyText, this.Font,Brushes.Black, e.ClipRectangle);
168仿listBox写了一个Control控件为item的列表集合                return;
169仿listBox写了一个Control控件为item的列表集合            }

170仿listBox写了一个Control控件为item的列表集合            
171仿listBox写了一个Control控件为item的列表集合           
172仿listBox写了一个Control控件为item的列表集合            //e.Graphics.DrawRectangle(new Pen(Brushes.Black),this.Left,this.Top,this.Width,this.Height);
173仿listBox写了一个Control控件为item的列表集合            for (int i = 0; i < itemList.Count; i++)
174仿listBox写了一个Control控件为item的列表集合            {
175仿listBox写了一个Control控件为item的列表集合                Point location = new Point(0, i * this.itemHeight);
176仿listBox写了一个Control控件为item的列表集合                Rectangle bound = new Rectangle(location, new Size(this.Size.Width, this.itemHeight));
177仿listBox写了一个Control控件为item的列表集合                OnDrawItem(new DrawItemEventArgsMySelf(bound, i, e.Graphics));
178仿listBox写了一个Control控件为item的列表集合            }

179仿listBox写了一个Control控件为item的列表集合        }

180仿listBox写了一个Control控件为item的列表集合        /// <summary>
181仿listBox写了一个Control控件为item的列表集合        /// 画每一项
182仿listBox写了一个Control控件为item的列表集合        /// </summary>
183仿listBox写了一个Control控件为item的列表集合        /// <param name="e"></param>

184仿listBox写了一个Control控件为item的列表集合        protected void OnDrawItem(DrawItemEventArgsMySelf e)
185仿listBox写了一个Control控件为item的列表集合        {
186仿listBox写了一个Control控件为item的列表集合            Graphics g = e.Graphics;
187仿listBox写了一个Control控件为item的列表集合            Pen pen = new Pen(Brushes.Wheat);
188仿listBox写了一个Control控件为item的列表集合            g.DrawRectangle(pen, e.Bound);
189仿listBox写了一个Control控件为item的列表集合
190仿listBox写了一个Control控件为item的列表集合            int index = e.Index;
191仿listBox写了一个Control控件为item的列表集合            if (index > -1 && index < itemList.Count)
192仿listBox写了一个Control控件为item的列表集合            {
193仿listBox写了一个Control控件为item的列表集合                Control ctr = itemList[index].ItemControl;
194仿listBox写了一个Control控件为item的列表集合                if (ctr.Parent == null)
195仿listBox写了一个Control控件为item的列表集合                {
196仿listBox写了一个Control控件为item的列表集合                    ctr.Parent = this;
197仿listBox写了一个Control控件为item的列表集合                
198仿listBox写了一个Control控件为item的列表集合                    ctr.Height = e.Bound.Height;
199仿listBox写了一个Control控件为item的列表集合                   if( ctr.Width >this.Width)
200仿listBox写了一个Control控件为item的列表集合                     ctr.Width = this.Width - 5;
201仿listBox写了一个Control控件为item的列表集合                    toolTip1.SetToolTip(ctr, itemList[index].ItemDescribe);
202仿listBox写了一个Control控件为item的列表集合                }

203仿listBox写了一个Control控件为item的列表集合                ctr.Location = e.Bound.Location;
204仿listBox写了一个Control控件为item的列表集合
205仿listBox写了一个Control控件为item的列表集合            }

206仿listBox写了一个Control控件为item的列表集合        }

207仿listBox写了一个Control控件为item的列表集合
208仿listBox写了一个Control控件为item的列表集合        public bool List_Validating()
209仿listBox写了一个Control控件为item的列表集合        {  bool isValidated = true;
210仿listBox写了一个Control控件为item的列表集合            foreach (Item item in itemList)
211仿listBox写了一个Control控件为item的列表集合            {
212仿listBox写了一个Control控件为item的列表集合                isValidated = isValidated && ListItemControls_Validating(item.ItemControl, new CancelEventArgs());
213仿listBox写了一个Control控件为item的列表集合            }

214仿listBox写了一个Control控件为item的列表集合            return isValidated;
215仿listBox写了一个Control控件为item的列表集合        }

216仿listBox写了一个Control控件为item的列表集合
217仿listBox写了一个Control控件为item的列表集合        public bool ListItemControls_Validating(object sender, CancelEventArgs e)
218仿listBox写了一个Control控件为item的列表集合        {
219仿listBox写了一个Control控件为item的列表集合            Control ctr = sender as Control;
220仿listBox写了一个Control控件为item的列表集合            Item item = itemList[ctr];
221仿listBox写了一个Control控件为item的列表集合            
222仿listBox写了一个Control控件为item的列表集合            if (string.IsNullOrEmpty(item.Regex))
223仿listBox写了一个Control控件为item的列表集合                return true;
224仿listBox写了一个Control控件为item的列表集合            Regex regex = new Regex(item.Regex);
225仿listBox写了一个Control控件为item的列表集合
226仿listBox写了一个Control控件为item的列表集合            string text = ctr.Text.Trim();
227仿listBox写了一个Control控件为item的列表集合            if (!regex.IsMatch(text))
228仿listBox写了一个Control控件为item的列表集合            {
229仿listBox写了一个Control控件为item的列表集合                err.SetIconAlignment(ctr, ErrorIconAlignment.MiddleRight);
230仿listBox写了一个Control控件为item的列表集合                err.SetIconPadding(ctr, 3);
231仿listBox写了一个Control控件为item的列表集合                err.SetError(ctr, item.ErrorMessage);
232仿listBox写了一个Control控件为item的列表集合                return false;
233仿listBox写了一个Control控件为item的列表集合            }

234仿listBox写了一个Control控件为item的列表集合            err.Clear();
235仿listBox写了一个Control控件为item的列表集合           
236仿listBox写了一个Control控件为item的列表集合            return true;
237仿listBox写了一个Control控件为item的列表集合        }

238仿listBox写了一个Control控件为item的列表集合        private void InitializeComponent()
239仿listBox写了一个Control控件为item的列表集合        {
240仿listBox写了一个Control控件为item的列表集合
241仿listBox写了一个Control控件为item的列表集合            this.components = new System.ComponentModel.Container();
242仿listBox写了一个Control控件为item的列表集合            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
243仿listBox写了一个Control控件为item的列表集合            this.SuspendLayout();
244仿listBox写了一个Control控件为item的列表集合            this.ResumeLayout(false);
245仿listBox写了一个Control控件为item的列表集合
246仿listBox写了一个Control控件为item的列表集合        }

247仿listBox写了一个Control控件为item的列表集合
248仿listBox写了一个Control控件为item的列表集合        private IContainer components;
249仿listBox写了一个Control控件为item的列表集合    }

250仿listBox写了一个Control控件为item的列表集合
251仿listBox写了一个Control控件为item的列表集合    public class ListItemColloction : List<Item>
252仿listBox写了一个Control控件为item的列表集合    {
253仿listBox写了一个Control控件为item的列表集合        public Item this[Control itemControl]
254仿listBox写了一个Control控件为item的列表集合        {
255仿listBox写了一个Control控件为item的列表集合            get
256仿listBox写了一个Control控件为item的列表集合            {
257仿listBox写了一个Control控件为item的列表集合                for (int i = 0; i < this.Count; i++)
258仿listBox写了一个Control控件为item的列表集合                {
259仿listBox写了一个Control控件为item的列表集合                    if (this[i].ItemControl.Equals(itemControl))
260仿listBox写了一个Control控件为item的列表集合                        return this[i];
261仿listBox写了一个Control控件为item的列表集合                }

262仿listBox写了一个Control控件为item的列表集合                return null;
263仿listBox写了一个Control控件为item的列表集合            }

264仿listBox写了一个Control控件为item的列表集合
265仿listBox写了一个Control控件为item的列表集合            set
266仿listBox写了一个Control控件为item的列表集合            {
267仿listBox写了一个Control控件为item的列表集合                for (int i = 0; i < this.Count; i++)
268仿listBox写了一个Control控件为item的列表集合                {
269仿listBox写了一个Control控件为item的列表集合                    if (this[i].ItemControl.Equals(itemControl))
270仿listBox写了一个Control控件为item的列表集合                        this[i] = value;
271仿listBox写了一个Control控件为item的列表集合                }

272仿listBox写了一个Control控件为item的列表集合            }

273仿listBox写了一个Control控件为item的列表集合        }

274仿listBox写了一个Control控件为item的列表集合    }

275仿listBox写了一个Control控件为item的列表集合
276仿listBox写了一个Control控件为item的列表集合    [Serializable]
277仿listBox写了一个Control控件为item的列表集合    public class Item
278仿listBox写了一个Control控件为item的列表集合    {
279仿listBox写了一个Control控件为item的列表集合        private Control itemControl = null;
280仿listBox写了一个Control控件为item的列表集合        private string itemDescible = string.Empty;
281仿listBox写了一个Control控件为item的列表集合        private string regex = string.Empty;
282仿listBox写了一个Control控件为item的列表集合        private string errorMessage = string.Empty;
283仿listBox写了一个Control控件为item的列表集合        public Item()
284仿listBox写了一个Control控件为item的列表集合        {
285仿listBox写了一个Control控件为item的列表集合        }

286仿listBox写了一个Control控件为item的列表集合
287仿listBox写了一个Control控件为item的列表集合        public Item(Control itemControl, string itemDescible,string regex,string errorMessage)
288仿listBox写了一个Control控件为item的列表集合        {
289仿listBox写了一个Control控件为item的列表集合            this.itemControl = itemControl;
290仿listBox写了一个Control控件为item的列表集合            this.itemDescible = itemDescible;
291仿listBox写了一个Control控件为item的列表集合            this.regex = regex;
292仿listBox写了一个Control控件为item的列表集合            this.errorMessage = errorMessage;
293仿listBox写了一个Control控件为item的列表集合        }

294仿listBox写了一个Control控件为item的列表集合        public Item(Control itemControl, string itemDescible)
295仿listBox写了一个Control控件为item的列表集合        {
296仿listBox写了一个Control控件为item的列表集合            this.itemControl = itemControl;
297仿listBox写了一个Control控件为item的列表集合            this.itemDescible = itemDescible;
298仿listBox写了一个Control控件为item的列表集合           
299仿listBox写了一个Control控件为item的列表集合        }

300仿listBox写了一个Control控件为item的列表集合        public string Regex
301仿listBox写了一个Control控件为item的列表集合        {
302仿listBox写了一个Control控件为item的列表集合            get
303仿listBox写了一个Control控件为item的列表集合            {
304仿listBox写了一个Control控件为item的列表集合                return regex;
305仿listBox写了一个Control控件为item的列表集合            }

306仿listBox写了一个Control控件为item的列表集合            set
307仿listBox写了一个Control控件为item的列表集合            {
308仿listBox写了一个Control控件为item的列表集合                regex = value;
309仿listBox写了一个Control控件为item的列表集合            }

310仿listBox写了一个Control控件为item的列表集合        }

311仿listBox写了一个Control控件为item的列表集合        public Control ItemControl
312仿listBox写了一个Control控件为item的列表集合        {
313仿listBox写了一个Control控件为item的列表集合            get
314仿listBox写了一个Control控件为item的列表集合            {
315仿listBox写了一个Control控件为item的列表集合                return itemControl;
316仿listBox写了一个Control控件为item的列表集合            }

317仿listBox写了一个Control控件为item的列表集合            set
318仿listBox写了一个Control控件为item的列表集合            {
319仿listBox写了一个Control控件为item的列表集合                itemControl = value;
320仿listBox写了一个Control控件为item的列表集合            }

321仿listBox写了一个Control控件为item的列表集合        }

322仿listBox写了一个Control控件为item的列表集合
323仿listBox写了一个Control控件为item的列表集合        public string ItemDescribe
324仿listBox写了一个Control控件为item的列表集合        {
325仿listBox写了一个Control控件为item的列表集合            get
326仿listBox写了一个Control控件为item的列表集合            {
327仿listBox写了一个Control控件为item的列表集合                return itemDescible;
328仿listBox写了一个Control控件为item的列表集合            }

329仿listBox写了一个Control控件为item的列表集合
330仿listBox写了一个Control控件为item的列表集合            set
331仿listBox写了一个Control控件为item的列表集合            {
332仿listBox写了一个Control控件为item的列表集合                itemDescible = value;
333仿listBox写了一个Control控件为item的列表集合            }

334仿listBox写了一个Control控件为item的列表集合        }

335仿listBox写了一个Control控件为item的列表集合
336仿listBox写了一个Control控件为item的列表集合        public string ErrorMessage
337仿listBox写了一个Control控件为item的列表集合        {
338仿listBox写了一个Control控件为item的列表集合            get
339仿listBox写了一个Control控件为item的列表集合            {
340仿listBox写了一个Control控件为item的列表集合                return errorMessage;
341仿listBox写了一个Control控件为item的列表集合            }

342仿listBox写了一个Control控件为item的列表集合            set
343仿listBox写了一个Control控件为item的列表集合            {
344仿listBox写了一个Control控件为item的列表集合                errorMessage = value;
345仿listBox写了一个Control控件为item的列表集合            }

346仿listBox写了一个Control控件为item的列表集合        }

347仿listBox写了一个Control控件为item的列表集合
348仿listBox写了一个Control控件为item的列表集合    }

349仿listBox写了一个Control控件为item的列表集合    public class DrawItemEventArgsMySelf : EventArgs
350仿listBox写了一个Control控件为item的列表集合    {
351仿listBox写了一个Control控件为item的列表集合        private Rectangle bound = Rectangle.Empty;
352仿listBox写了一个Control控件为item的列表集合
353仿listBox写了一个Control控件为item的列表集合        private int index;
354仿listBox写了一个Control控件为item的列表集合        private Graphics graphics;
355仿listBox写了一个Control控件为item的列表集合        public Graphics Graphics
356仿listBox写了一个Control控件为item的列表集合        {
357仿listBox写了一个Control控件为item的列表集合            get
358仿listBox写了一个Control控件为item的列表集合            {
359仿listBox写了一个Control控件为item的列表集合                return this.graphics;
360仿listBox写了一个Control控件为item的列表集合            }

361仿listBox写了一个Control控件为item的列表集合        }

362仿listBox写了一个Control控件为item的列表集合        public DrawItemEventArgsMySelf(Rectangle bound, int index, Graphics g)
363仿listBox写了一个Control控件为item的列表集合        {
364仿listBox写了一个Control控件为item的列表集合            this.bound = bound;
365仿listBox写了一个Control控件为item的列表集合
366仿listBox写了一个Control控件为item的列表集合            this.index = index;
367仿listBox写了一个Control控件为item的列表集合            this.graphics = g;
368仿listBox写了一个Control控件为item的列表集合        }

369仿listBox写了一个Control控件为item的列表集合        public Rectangle Bound
370仿listBox写了一个Control控件为item的列表集合        {
371仿listBox写了一个Control控件为item的列表集合            get
372仿listBox写了一个Control控件为item的列表集合            {
373仿listBox写了一个Control控件为item的列表集合                return this.bound;
374仿listBox写了一个Control控件为item的列表集合            }

375仿listBox写了一个Control控件为item的列表集合        }

376仿listBox写了一个Control控件为item的列表集合
377仿listBox写了一个Control控件为item的列表集合
378仿listBox写了一个Control控件为item的列表集合        public int Index
379仿listBox写了一个Control控件为item的列表集合        {
380仿listBox写了一个Control控件为item的列表集合            get
381仿listBox写了一个Control控件为item的列表集合            {
382仿listBox写了一个Control控件为item的列表集合                return index;
383仿listBox写了一个Control控件为item的列表集合            }

384仿listBox写了一个Control控件为item的列表集合        }

385仿listBox写了一个Control控件为item的列表集合       
386仿listBox写了一个Control控件为item的列表集合    }

387仿listBox写了一个Control控件为item的列表集合}

388仿listBox写了一个Control控件为item的列表集合
仿listBox写了一个Control控件为item的列表集合


作者:破  狼 
出处:http://www.cnblogs.com/whitewolf/ 
本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。该文章也同时发布在我的独立博客中-个人独立博客博客园--破狼51CTO--破狼。http://www.cnblogs.com/whitewolf/archive/2009/10/12/1581928.html