摘要: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 class Customer { public int ID { get; set; } public static bool Test(Customer x) { return x.ID == 5; } 阅读全文
posted @ 2016-08-15 15:31 褚海达 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 主界面: Form1中的代码: namespace _06委托练习_窗体传值{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btn1_Click(object s 阅读全文
posted @ 2016-08-14 21:04 褚海达 阅读(528) 评论(0) 推荐(0) 编辑
摘要: 下面函数是经常用到的计算字串长度的方法: private double MeasureTextWidth(String str, string fontName, double fontsize, double width) { double width = -1; try { System.Dra 阅读全文
posted @ 2016-06-23 11:18 褚海达 阅读(1561) 评论(0) 推荐(0) 编辑
摘要: SELECT top 10[HFMBDATA].query('(/Items/Item[@ID=''tbBryj''])').value('(//TextValue)[1]','nvarchar(max)') as mz,[HFMBDATA].value('(Items/Item[@ID="rb_f... 阅读全文
posted @ 2015-06-18 16:30 褚海达 阅读(1642) 评论(0) 推荐(0) 编辑
摘要: select BQDM,sum(case when HFBZ='0' then 1 ELSE 0 end) bxschf,sum(case when HFBZ='1' then 1 ELSE 0 end) xschf,sum(case when HFBZ='2' then 1 ELSE 0 end)... 阅读全文
posted @ 2015-06-17 12:17 褚海达 阅读(1653) 评论(0) 推荐(0) 编辑
摘要: WPF中,最简单最容易播放音频的方式是使用SoundPlayer类。它是.NET Framework 2.0的一部分,是对Win32 PlaySound API的封装。它具有以下限制:1)仅支持.wav音频文件;2)不支持同时播放多个音频(任何新播放的操作将终止当前正在播放的);3)无法控制声音的音... 阅读全文
posted @ 2015-01-30 09:19 褚海达 阅读(9776) 评论(1) 推荐(1) 编辑
摘要: 在WPF中,许多控件都自动集成了固有的命令集。比如文本框TextBox就提供了复制(Copy),粘贴(Paste),裁切(Cut),撤消(Undo)和重做(Redo)命令等。WPF提供常用应用程序所用的命令集,常用的命令集包括:ApplicationCommands, ComponentComman... 阅读全文
posted @ 2014-12-16 09:58 褚海达 阅读(524) 评论(0) 推荐(0) 编辑
摘要: private void tbYyrs_KeyUp(object sender, KeyEventArgs e) { UIElement element = Keyboard.FocusedElement as UIElement; if (... 阅读全文
posted @ 2014-11-03 18:53 褚海达 阅读(571) 评论(0) 推荐(0) 编辑
摘要: 对于TreeView而言: TreeViewAutomationPeer lvap = new TreeViewAutomationPeer(treeView); var svap = lvap.GetPattern(PatternInterface.Sc... 阅读全文
posted @ 2014-10-11 16:33 褚海达 阅读(1987) 评论(0) 推荐(1) 编辑
摘要: /// /// 导出datatable到word /// /// 需要中文列名的表 public static void ExportWord(DataTable dg) { try { ... 阅读全文
posted @ 2014-08-15 09:24 褚海达 阅读(1402) 评论(0) 推荐(0) 编辑