- 博客(2)
- 收藏
- 关注
原创 WPF中WatermarkTextBox(水印文本框)的实现
我们经常能在很多设计中看到当文本框为空的时候显示灰色斜体的提示性文字,这样可以省略文本框前的标签说明,同时也会使设计变得美观。在html中我们只需要给input加上placeholder就行了,那么在wpf中怎么做呢? 首先我继承System.Windows.Controls.TextBox实现WatermarkTextBox的类,并添加一个Watermark的string属性,用于设置水印文字
2013-10-03 08:45:12
6028
原创 继承自HashAlgorithm的CRC16实现
最近做一个项目用Modbus RTU协议和设备通信,需要用到CRC16进行数据校检。而.net BCL并未提供CRC16的算法,于是自己写了一个,以便后用。 CRC16.cs using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Security.
2013-09-27 23:43:50
1265
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅