
C#
wolfzz88
这个作者很懒,什么都没留下…
展开
-
WPF开发,Image与ImageSource
GUI调用dll中的函数A改变后台绑定数据,如果前台为Image,后台为ImageSource。在更新时,不能将dll中的ImageSource直接赋值给界面的后台对象的ImageSource,要将DLL数据存为Bitmap,在界面转换成ImageSource。否则运行时产生异常。原创 2016-10-12 16:32:27 · 2147 阅读 · 0 评论 -
C#,大文件读取时快速定位,部分读取
当文件很大时,不可能把所有数据读入内存,所以对于具有相同长度的排列数据,可以采用偏移定位法直接将指针移动到起始位置,然后读取对应长度。在C#中可以使用FileStream类的seek方法。原创 2016-10-12 16:47:57 · 4858 阅读 · 0 评论 -
DataGridCell Style
内容居中,保证行鼠标点击选中resource中定义style原创 2017-03-08 09:17:55 · 3235 阅读 · 0 评论 -
使用RenderTargetBitmap获取WPF控件图像
在获取控件图像的时候,需要使用border包含控件,否则因为margin和其他设置导致获取的图像不对。原创 2017-03-08 09:29:21 · 2978 阅读 · 1 评论 -
Datagrid通过button控制row上下滚动效果
按钮中 Dispatcher.Invoke( new Action( delegate () { DataGrid.SelectedIndex = 0;原创 2017-03-13 17:56:32 · 522 阅读 · 0 评论 -
C#对List<object>进行多属性排序
最近做对象集合多属性排序,在网上找了好久,最终找到一个。原文地址https://www.codeproject.com/articles/29219/sorting-collections-by-multiple-properties转载 2017-03-15 16:09:41 · 1438 阅读 · 0 评论 -
Data Grid后台代码添加column
private void AddColumn(string header) { DataGridTextColumn addColumn = new DataGridTextColumn(); addColumn.Header = header; addColumn.Binding = new Bind原创 2017-04-25 14:47:14 · 855 阅读 · 0 评论