文章分类 -  WinForm

C# 实现自定义消息处理
摘要:众所周知,委托和事件机制是C#应用程序的一个很重要的方面。 Microsoft 的 BCL 类库对Windows的控件进行了几乎全面的封装,使应用程序开发人员甚至不用了解消息循 环就能写出相样的程序。 然而,甚至Windows UI编程到了 WPF 时代,消息机制仍然占据着举足轻重的作用。可以这么说,没有消息 循环就没有Windows。(当然WPF很大程度上是对D3D的封装,它本身并不是基... 阅读全文

posted @ 2008-11-23 13:54 冯赞锋 阅读(486) 评论(0) 推荐(0)

.NET中截获处理消息
摘要:.NET中截获处理消息 1、重载DefWndProc方法 protected override void DefWndProc(ref Message m) { if ( m.Msg ==... 阅读全文

posted @ 2008-11-23 13:53 冯赞锋 阅读(533) 评论(0) 推荐(0)

C#如监控U盘插入拔出、光驱监控的问题
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropService... 阅读全文

posted @ 2008-11-23 13:52 冯赞锋 阅读(1259) 评论(1) 推荐(0)

C# richTextbox的 字体格式颜色等等
摘要:【关于字体格式】 设置的是第一个字符的颜色,这时richtextBox的rtf中记录下位置0的颜色,重置text时,在rtf中的位置从位置0开始,因此颜色还是Color.Red,第三次也应该同样如此 richTextBox1.Text = "123"; richTextBox1.Select(0, 1); richTextBox1.SelectionColor = Color.Red; richT... 阅读全文

posted @ 2008-11-23 12:57 冯赞锋 阅读(12731) 评论(0) 推荐(0)

C#中使用picturebox按比例显示图片
摘要:C#中使用picturebox按比例显示图片 C#代码 using System; using System.Collections.Generic;... 阅读全文

posted @ 2008-11-22 20:43 冯赞锋 阅读(11233) 评论(0) 推荐(0)