跟小D每日学口语
摘要: 下面的代码只是在处理折行,可以再加入控制该机能的属性,以及保留原值的属性,这样就可以达到比较完美的自定义控件了。public partial class MyLabel : Label{ public MyLabel() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { SizeF thisSize = e.Graphics.MeasureString(this.Text, this.Font); if (thisS... 阅读全文
posted @ 2012-05-16 18:01 Danny Chen 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 初学C#的时候,老是被IEnumerable、IEnumerator、ICollection等这样的接口弄的糊里糊涂,我觉得有必要切底的弄清楚IEnumerable和IEnumerator的本质。下面我们先看IEnumerable和IEnumerator两个接口的语法定义。其实IEnumerable接口是非常的简单,只包含一个抽象的方法GetEnumerator(),它返回一个可用于循环访问集合的IEnumerator对象。IEnumerator对象有什么呢?它是一个真正的集合访问器,没有它,就不能使用foreach语句遍历集合或数组,因为只有IEnumerator对象才能访问集合中的项,假如 阅读全文
posted @ 2012-05-16 10:38 Danny Chen 阅读(395) 评论(1) 推荐(0) 编辑