摘要:对于这样一个小示例。不再做什么讲解,主要是实现思路清晰就够了。先看一下结果:核心代码[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
阅读全文
摘要: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
阅读全文
摘要:代码如下: <RadioButton x:Name="twoRb" GroupName="oneGroup" Style="{StaticResource NormalRadioButtonStyle}">数量</RadioButton> <TextBlock Style="{StaticResource NormalTextBlockStyle}" Margin="15,0,0,0">:</TextBlock> <TextBox Width
阅读全文
摘要:方法一:<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
阅读全文
摘要:话说现在的项目中我要用进度条了。本想用自带的那个ProcessBar控件,可是样式不好看,加上自己本事有限,对WPF中的样式相当的不熟。只好想别的办法了。不知哪根儿神经一动,我想到了用Rectangle控件。知道这个控件的一定就知道我是怎么想的了。具体通过DispatcherTimer类实现。因为这个类有一个Interval属性设置使用的多长时间完成,再加上一个Tick事件,每一毫秒就会触发一下这个Tick事件。当然大多数情况下我们不会这么频繁的触发这个事件。具体就跟实际情况而定了。关于DispatcherTimer类,还是让MSDN来讲吧,http://msdn.microsoft.com/
阅读全文
摘要:private GridView BindHeader(DataTable dtSource) { GridView gv = new GridView(); foreach (DataColumn item in dtSource.Columns) { GridViewColumn gvc = new GridViewColumn(); gvc.Header = item.ColumnName; //这里面的tmpRig...
阅读全文
摘要: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...
阅读全文