繁星世界

 

随笔分类 -  .net WinForm

dot net windows界面相关的使用方法及技巧
生成随机数
摘要:private static readonly char[] constant = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j 阅读全文

posted @ 2012-09-04 14:09 繁星世界 阅读(110) 评论(0) 推荐(0)

DataGridView绑定List集合删除焦点行未变的解决方案
摘要:dgvMain.DataSource = new BindingList<集合对象>(绑定集合); 阅读全文

posted @ 2012-01-10 17:05 繁星世界 阅读(387) 评论(0) 推荐(0)

4位时间格式正则表达式[从0000~2359]
摘要:using System.Text.RegularExpressions;Regex.IsMatch(strStartTime, "^([0-1]+[0-9]|2[0-3])([0-5][0-9])$"); 阅读全文

posted @ 2012-01-05 16:39 繁星世界 阅读(637) 评论(0) 推荐(0)

WinForm中DataGridView获取当前行绑定数据扩展
摘要:public static T GetCurrentRowObject<T>(this DataGridView dv) { CurrencyManager cm = (CurrencyManager)dv.BindingContext[dv.DataSource]; return (T)cm.Current; } 阅读全文

posted @ 2011-12-16 12:46 繁星世界 阅读(662) 评论(0) 推荐(0)

WinForm中DataGridView只绑定自定义列
摘要:在绑定数据之前或窗体构造完后加一句 DataGridView1.AutoGenerateColumns = false;即可。AutoGenerateColumns 在设计属性中没有,只能在代码中加入。 阅读全文

posted @ 2011-12-16 12:37 繁星世界 阅读(709) 评论(0) 推荐(0)

导航

小花生网