(注:Logical Tree中文称为逻辑树,Visual Tree中文称为可视化树或者视觉树,由于名称不是很统一,文中统一用英文名称代表两个概念,况且VisualTreeHelper和LogicalTreeHelper也是WPF中提供的类名称) 众所周知WPF中的Logical Tree是逻辑上定...
分类:
其他好文 时间:
2014-08-15 12:43:48
阅读次数:
194
WPF中改变选中行的颜色是很简单的,就是用触发器:比如:以DataGrid为例: DataGrid.RowStyle Style TargetType= DataGridRow SetterProperty= Background Value= White / Style .Triggers Tri...
分类:
其他好文 时间:
2014-08-15 12:11:28
阅读次数:
232
Well, in WPF the difference between ListView and DataGrid is just one. Editing. You need editing use DataGrid, otherwise use ListView. You can edit in...
分类:
其他好文 时间:
2014-08-15 12:11:19
阅读次数:
211
DataGrid运行效果: xaml 代码: DataGridName= dtgData ItemsSource= {Binding} AutoGenerateColumns= False DataGrid.Columns DataGridTextColumnBinding= {BindingPat...
分类:
其他好文 时间:
2014-08-15 11:59:48
阅读次数:
231
一、功能、布局描述
1、使用Grid的GridSplitter实现可拖拽分隔栏效果。当ShowsPreview设置为True时,拖拽过程中不会刷新(控件内容要等到鼠标释放时才变化);当ShowsPreview设置为False时,控件内容实时跟随变化。
2、使用ViewBox特性实现控件内容随拖拽自动变化。
3、布局代码:
...
分类:
其他好文 时间:
2014-08-15 10:48:08
阅读次数:
246
public void GetPath(System.Windows.Controls.TextBox TB) { FolderBrowserDialog FBD = new FolderBrowserDialog(); FB...
分类:
其他好文 时间:
2014-08-14 19:59:19
阅读次数:
204
1、WPF的一个触摸屏项目,需要输入姓名,但是屏幕不支持汉字输入,使用虚拟键盘不稳定,为了解决该问题特此进行处理。2、新建一个类转换类,里面初始化一个数组,数组包含拼音,以及拼音下的常用的汉字。3、根据拼音,对照出对应的汉字,然后在对汉字进行拆分,获取到单个汉字。例子如下: private stat...
分类:
其他好文 时间:
2014-08-14 19:45:39
阅读次数:
173
这儿需要使用两个系统函数:BOOL WINAPI FreeConsole(void); //// 关闭控制台窗口,参考:http://msdn.microsoft.com/en-us/library/ms683150%28VS.85%29.aspxBOOL WINAPI AllocConsole(v...
BitmapImage bi = new BitmapImage(); // BitmapImage.UriSource must be in a BeginInit/EndInit block. bi.BeginInit(); ...
分类:
其他好文 时间:
2014-08-14 15:50:28
阅读次数:
277
前一阵在园子里看到一篇文章《使用css3仿造window7的开始菜单》,文中仅使用CSS3 实现了Windows 7 开始菜单的动态效果,很久以来一直被WPF/Silverlight 山上的风景所吸引,未成想其他的山也同样引人入胜。于是心血来潮也尝试着做了一个Windows 7 桌面效果,先来看几张...