随笔分类 -  WPF

客户端应用
摘要:同级或上下级关系时,事件的响应者可订阅事件的发起者;通过委托,事件的响应者使用事件的处理器来做出交互响应。 多级关系时,路由事件的事件拥有者和事件的响应者之间则没有直接的显式订阅关系,事件的拥有者则只负责激发事件,事件将有谁响应它并不知道;事件的响应者则有事件的监听器,针对事件进行监听,当有此类事件 阅读全文
posted @ 2020-04-15 18:02 wesson2019 阅读(182) 评论(0) 推荐(0)
摘要:Binding 阅读全文
posted @ 2020-04-02 14:27 wesson2019 阅读(2658) 评论(0) 推荐(0)
摘要:Constructor Initialized SourceInitialized 显示窗口,事件发生后获取窗体的句柄,并且可注册全局快捷键。 Activated 活动窗口 Loaded 所有内容都显示给用户之前执行,窗口渲染完成,但是还没有执行任何交互时触发,在程序加载期间做一些初始化操作 Dea 阅读全文
posted @ 2020-03-27 18:15 wesson2019 阅读(413) 评论(0) 推荐(0)
摘要:using System.Configuration App.config Configuration _config; string _paraPath = "Path"; public MainWindow() { InitializeComponent(); this.Dispatcher.S 阅读全文
posted @ 2020-03-25 14:45 wesson2019 阅读(150) 评论(0) 推荐(0)
摘要:蒙版 弹出 窗体 窗口 弹窗 阅读全文
posted @ 2020-03-19 16:10 wesson2019 阅读(1629) 评论(0) 推荐(0)
摘要:using System.Windows.Forms; Demo private void Window_Loaded(object sender, RoutedEventArgs e) { InitialTray(); } private void Window_Closing(object se 阅读全文
posted @ 2020-03-19 16:09 wesson2019 阅读(1966) 评论(0) 推荐(0)
摘要:主窗口居中置顶 public MainWindow() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; this.Topmost = true; } private void W 阅读全文
posted @ 2020-03-19 16:05 wesson2019 阅读(2730) 评论(0) 推荐(0)
摘要:Application.Exit 通知winform消息循环退出,会在所有前台线程退出后,才真正的退出应用。(先停止线程,然后终止进程)。 如果前台线程还在运行,往往会造成Application.Exit失效。 解决方法之一: //先关闭窗口 this.Close(); //再退出程序 Applic 阅读全文
posted @ 2020-03-06 15:44 wesson2019 阅读(656) 评论(0) 推荐(0)
摘要:using System.Diagnostics; 以静默方式运行bat脚本 Console.WriteLine("同步执行"); Console.WriteLine(CMDHelper.CMDExecute("TimeStampVerificationCode.bat")); Console.Wr 阅读全文
posted @ 2020-01-09 17:54 wesson2019 阅读(579) 评论(0) 推荐(0)
摘要:需要内部控件实现滚动的控件(比如treeview1中的内容超过面板大小时,滚动条会自动出现,鼠标在控件内部内容上时),鼠标滚轮滚动无效。 滚动条嵌套响应鼠标滑轮事件的处理,由于xaml前台绑定时触发不了MouseWheel事件,需要在构造函数中引发鼠标滚轮的路由事件。 public UC_XXXXX 阅读全文
posted @ 2020-01-08 17:10 wesson2019 阅读(520) 评论(0) 推荐(0)
摘要:窗体、控件句柄 窗体句柄: IntPtr hwnd = new WindowInteropHelper(this).Handle; 控件句柄: IntPtr hwnd = ((HwndSource)PresentationSource.FromVisual(uielement)).Handle; 不 阅读全文
posted @ 2020-01-06 11:44 wesson2019 阅读(903) 评论(0) 推荐(0)
摘要:Popup XAML <Button x:Name="img1" Width="16" Height="16" Margin="0" Padding="2" Click="img1_Click"> <Button.Content> <Image Source="{DynamicResource Im 阅读全文
posted @ 2019-12-09 10:50 wesson2019 阅读(170) 评论(0) 推荐(0)
摘要:TextBlock、textbox 阅读全文
posted @ 2019-12-05 13:57 wesson2019 阅读(870) 评论(0) 推荐(0)
摘要:ProgressBarEx 阅读全文
posted @ 2019-12-01 15:21 wesson2019 阅读(123) 评论(0) 推荐(0)
摘要:DataGrid单列宽度改变时,通知其他对象 // 扩展 DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(DataGridColumn.WidthProperty, typeof( 阅读全文
posted @ 2019-11-21 16:54 wesson2019 阅读(318) 评论(0) 推荐(0)
摘要:ScrollViewer 阅读全文
posted @ 2019-11-12 20:20 wesson2019 阅读(1896) 评论(0) 推荐(0)