随笔分类 - WPF
WPF技术积累
摘要:提问 WPF项目如何使用日志 回答 引入nuget log4net 加入配置特性 [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are locat
阅读全文
摘要:提问 WPF 如何添加系统托盘 回答 1.引入nuget handycontrol cs xmlns:hc="https://handyorg.github.io/handycontrol" 2.窗体添加控件 cs <hc:NotifyIcon x:Name="NotifyIconContextCo
阅读全文
摘要:提问 如何实现Handy Control DataGrid 全选 回答 private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { if (((sender as CheckBox)!).IsChecked!.Value)
阅读全文
摘要:StackPanel增加滚动条 StackPanel本身是没有滚动条的但是外边包裹ScrollViewer就能滚动了,示例如下 <ScrollViewer Grid.Row="1" Margin="10" Background="{DynamicResource SecundaryBackgroun
阅读全文
摘要:使用MouseUp 触发选中行事件后续操作;
阅读全文
摘要:var cts = new CancellationTokenSource(); cancellationTokenSources.Add(cts); var t = Task.Run(() => { if (!cts.IsCancellationRequested) { //do somethin
阅读全文
摘要:1.当ListBox内容很多时 可使用异步动态加载友好显示 private ObservableCollection<ImageInfo> detailImages = new ObservableCollection<ImageInfo>(); public ObservableCollectio
阅读全文
摘要:1 public static void PrintwithoutDialog(this DocumentViewer viewer, FixedDocument fixedDoc) 2 { 3 PrintDialog pDialog = new PrintDialog(); 4 pDialog.P
阅读全文
摘要:1 System.Timers.Timer timer = new System.Timers.Timer(); 2 timer.Interval = 360; 3 timer.Elapsed += delegate 4 { 5 Application.Current.Dispatcher.Begi
阅读全文
摘要:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:the
阅读全文
摘要:<TextBox x:Name="cszd" HorizontalContentAlignment="Left" //水平居左 VerticalContentAlignment="Top" //垂直居上 TextWrapping="Wrap" //换行 AcceptsReturn="True" //
阅读全文
摘要:private void ContentControl_MouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton==MouseButtonState.Pressed) { this.DragMove(); } } <Win
阅读全文
摘要:添加 AllowsTransparency="True" 属性消除
阅读全文
摘要:<TextBox Name="xx" > <TextBox.InputBindings> <KeyBinding Command="{Binding MyCommand}" Key="Enter" CommandParameter="{Binding ElementName=xx}"/> </Tex
阅读全文
摘要:新建类型位wpf类库,不是 普通的类库,要有wpf引用 同时引用时注意样式依赖先后 被依赖的放在前面
阅读全文
摘要:PasswordBox 文本垂直居中 VerticalContentAlignment="Center"
阅读全文
摘要:删除标题栏 WindowStyle="None" 设置背景图片 <DockPanel Grid.Column="0" LastChildFill="False"> <DockPanel.Background> <ImageBrush ImageSource="/Resources/bgpic.png
阅读全文

浙公网安备 33010602011771号