11 2012 档案

摘要:private void Button_Paint(object sender, PaintEventArgs e){ Button btn = sender as Button; System.Drawing.Drawing2D.GraphicsPath btnPath = new System.Drawing.Drawing2D.GraphicsPath(); System.Drawing.Rectangle newRectangle = btn.ClientRectangle; newRectangle.Inflate(-1, -1); e.Graphics... 阅读全文
posted @ 2012-11-29 17:53 古兰色回忆 阅读(741) 评论(0) 推荐(0)
摘要:protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){ GraphicsPath oPath = new GraphicsPath(); int x = 0; int y = 0; int w = Width; int h = Height; int a = 14; Graphics g = CreateGraphics(); oPa... 阅读全文
posted @ 2012-11-29 17:33 古兰色回忆 阅读(851) 评论(0) 推荐(0)
摘要:int[] array = new int[2000];int fill = 9;ArrayList.Repeat(fill, 2000).CopyTo(array); 阅读全文
posted @ 2012-11-28 10:54 古兰色回忆 阅读(647) 评论(0) 推荐(0)
摘要:首先定义一个枚举 /// <summary> /// 枚举注释的自定义属性类 /// </summary> public class EnumDescriptionAttribute : Attribute { private string m_strDescription; public EnumDescriptionAttribute(string strPrinterName) { m_strDescription = strPrinterName; } public... 阅读全文
posted @ 2012-11-23 11:39 古兰色回忆 阅读(5908) 评论(0) 推荐(0)
摘要:public class 类{ private string _属性; public string 属性 { set { this._属性 = value; } get { return this._属性; } }}public class 执行{ public 执行() { } public void 方法() { 类 实例 = new 类(); object val = 实例.GetType().GetProperty("属性").GetValue(实例, null); }} 阅读全文
posted @ 2012-11-21 17:26 古兰色回忆 阅读(253) 评论(0) 推荐(0)
摘要:object obj = this.GetType().GetField("控件名称", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase).GetValue(this); Label lbl = (Label)obj; 阅读全文
posted @ 2012-11-21 17:22 古兰色回忆 阅读(4029) 评论(1) 推荐(2)
摘要:使用方法名的字符串,调用该类中的方法。 /// <summary>/// 绘制线性波形/// </summary>public void DrawLinear(){ //实现方法}private void button_click(object sender,EventArgs e){ this.GetType().GetMethod("DrawLinear").Invoke(this, null);}请注意被调用的方法一定要是公用的。 阅读全文
posted @ 2012-11-05 17:01 古兰色回忆 阅读(282) 评论(0) 推荐(0)