编程技巧 - 文章列表

  • WPF RichTextBox 集合被修改;枚举操作可能无法执行。

    tb1与tb2 都是RichTextBox,下面代码的目的是将tb2的内容添加到tb1里面去\nBlockCollection bc= tb2.Document.Blocks;\ntb1.Document.Blocks.AddRange(bc);//运行到这里时报错(集合被修改;枚举操作可能无法执行)。\n于是修改了一下:\nfor(int i=0;i 0){tb1.Document.Blocks.Add(bc.FirstBlock);\n}

  • WPF版的webbrowser 常用方法

    首先要引入Microsoft.mshtml.dll 地址是C:Program FilesMicrosoft.NETPrimary Interop Assemblies

  • wpf 实现状态栏图标

    首先需要在项目中引用System.Windows.Forms,System.Drawing;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Wind