01 2011 档案

摘要:1.创建一个C# windows应用程序2.添加一个windows表单Label到Form1.cs3.单击label1控件然后更改Text属性为空字符4.更改BorderStyle属性为FixedSingle5.右键单击Form1.cs,然后点击View Code添加下面Using语句到Form1.cs源码的顶部6.using System.Runtime.InteropServices;注意该步骤添加必要的引用来调用InteropServices函数和方法7.private Bitmap myBitmap;添加下面的Win32APICall 类到Form1.cs中的Form1类后面publi 阅读全文
posted @ 2011-01-24 23:26 瑞恩多芬 阅读(1803) 评论(0) 推荐(0)
摘要:c#中获取颜色的argb值:颜色有4个要素, A(Alpha,透明度),R(Red,红色成分),G(Green,绿色成分),B(Blue,蓝色成分),都是byte类型的,把他们合到一个Int32中就可以了. 举例: int mycolor; Color c = Color.Red; //自己设置想要的某个颜色。mycolor = c.A * 256 *256 * 256 + c.R * 256 * 256 + c.G * 256 + c.B ; 上面这段代码等价于int mycolor; ColorDialog c = new ColorDialog();c.ShowDialog();//弹出 阅读全文
posted @ 2011-01-24 02:12 瑞恩多芬 阅读(8084) 评论(0) 推荐(0)
摘要:一、label太短,无法完成显示所要显示信息长度,要换行,解决方法如下:(1)string aa =(长串) ; string cc= aa.Substring(0,10);//取前10个字符 string dd=aa.Substring(11);取后边的 Label.Text=cc.Trim() + "\n"(换行) +dd.Trim();(2)如果长串中有特殊字符,如' '(空格)string aa=(长串);string[] bb = aa.Split(new char[] {' '}); for (int i = 0; i <b 阅读全文
posted @ 2011-01-23 22:26 瑞恩多芬 阅读(37358) 评论(1) 推荐(0)