纸上得来终觉浅,绝知此事要躬行。

 

文章分类 -  WPF

WPF智能提示示例<一>
摘要:对于这样一个小示例。不再做什么讲解,主要是实现思路清晰就够了。先看一下结果:核心代码[XAML]:<Page x:Class="AutoCompleteWPF.Pages.Home" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/marku 阅读全文

posted @ 2013-04-07 23:58 JRoger 阅读(843) 评论(0) 推荐(0)

WPF模版[DataTemplate]使用
摘要:1 GridViewColumn gvc = new GridViewColumn(); 2 3 // Binding很强大,但是不知道怎么解释。从使用中慢慢体会 4 Binding binding = new Binding(); 5 6 // 绑定到此模版的数据源的属性路径 7 binding.Path = new PropertyPath("SerialNo"); 8 9 // MSDN:描述数据对象的可视结构。10 DataTemplate dtemplate = new DataTemplate();11 12 // 新建一个模版,参数说明这个模版依懒于哪个控件1 阅读全文

posted @ 2012-05-18 18:17 JRoger 阅读(450) 评论(0) 推荐(0)

WPF 将一个元素的依赖属性Binding到另一个元素的依赖属性上面
摘要:代码如下: <RadioButton x:Name="twoRb" GroupName="oneGroup" Style="{StaticResource NormalRadioButtonStyle}">数量</RadioButton> <TextBlock Style="{StaticResource NormalTextBlockStyle}" Margin="15,0,0,0">:</TextBlock> <TextBox Width 阅读全文

posted @ 2012-05-02 13:45 JRoger 阅读(812) 评论(0) 推荐(0)

WPF 依赖项属性[DependencyProperty]Text的绑定方式
摘要:方法一:<TextBlock Style="{StaticResource NormalTextBlockStyle}" Width="80" FontWeight="Bold" Margin="25,5,5,5"> <TextBlock.Text> <Binding Path="RechargeInfo.ZeroValue"StringFormat="{}{0:F2}" Mode="TwoWay" UpdateSourceT 阅读全文

posted @ 2012-04-25 15:39 JRoger 阅读(732) 评论(0) 推荐(0)

WPF手绘进度条
摘要:话说现在的项目中我要用进度条了。本想用自带的那个ProcessBar控件,可是样式不好看,加上自己本事有限,对WPF中的样式相当的不熟。只好想别的办法了。不知哪根儿神经一动,我想到了用Rectangle控件。知道这个控件的一定就知道我是怎么想的了。具体通过DispatcherTimer类实现。因为这个类有一个Interval属性设置使用的多长时间完成,再加上一个Tick事件,每一毫秒就会触发一下这个Tick事件。当然大多数情况下我们不会这么频繁的触发这个事件。具体就跟实际情况而定了。关于DispatcherTimer类,还是让MSDN来讲吧,http://msdn.microsoft.com/ 阅读全文

posted @ 2012-02-15 17:33 JRoger 阅读(4659) 评论(0) 推荐(1)

WPF中ListView 控制某行数据靠右显示
摘要:private GridView BindHeader(DataTable dtSource) { GridView gv = new GridView(); foreach (DataColumn item in dtSource.Columns) { GridViewColumn gvc = new GridViewColumn(); gvc.Header = item.ColumnName; //这里面的tmpRig... 阅读全文

posted @ 2011-12-26 11:25 JRoger 阅读(1513) 评论(0) 推荐(0)

WPF中为ListView动态绑定数据且添加一列复选框
摘要:GridView gv = new GridView();DataTable dt = fieldManageBLL.GetFieldManage(moduleName);for(int i=0;i<dt.Rows.Count;i++){ if(i==0) { GridViewColumn gvc=new GridViewColumn(); CheckBox cb = new CheckBox(); cb.Checked += new RoutedEventHandler(new SupplierPayBill().cb_Checked); cb.Content... 阅读全文

posted @ 2011-09-15 20:15 JRoger 阅读(7835) 评论(0) 推荐(0)

WPF样式学习一
只有注册用户登录后才能阅读该文。

posted @ 2011-08-23 19:07 JRoger 阅读(6) 评论(0) 推荐(0)

导航