随笔分类 -  c#

摘要:选择目录 System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog(); dialog.RootFolder = Environment.SpecialFolder.D 阅读全文
posted @ 2022-06-22 15:13 荣超 阅读(1733) 评论(0) 推荐(0) 编辑
摘要:Canvas布局 Canvas是一个类似于坐标系的面板,所有的元素通过设置坐标来决定其在坐标系中的位置。具体表现为使用Left、Top、Right、 Bottom附加属性在Canvas中定位控件 StackPanel布局 StackPanel将控件按照行或列来顺序排列,但不会换行。通过设置面板的Or 阅读全文
posted @ 2022-06-22 14:48 荣超 阅读(326) 评论(0) 推荐(0) 编辑
摘要:首先需要引入COM下面的Microsoft Shell Controls And Automation 引入后 名字为Shell32 点击Shell32 下面会有一个属性框 没有的话右击Shell32 点击属性 嵌入互操作类型修改为false 否则使用时会报错 代码中使用 Shell32.Shell 阅读全文
posted @ 2022-01-12 16:37 荣超 阅读(860) 评论(1) 推荐(1) 编辑
摘要:需要在程序集中添加 System.Windows.Forms WindowsFormsIntegration 阅读全文
posted @ 2022-01-04 10:34 荣超 阅读(750) 评论(0) 推荐(0) 编辑
摘要:Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => {// 在子线程中不能直接修改控件值会闪退 // 在这里修改控制值 })); 阅读全文
posted @ 2021-12-08 15:43 荣超 阅读(151) 评论(0) 推荐(0) 编辑
摘要:首先是application入口文件 using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Thre 阅读全文
posted @ 2021-09-15 10:37 荣超 阅读(547) 评论(0) 推荐(0) 编辑
摘要:直接读取出来是Bitmap类型 xmal 中无法直接转换,我们需要编写一个转换器 using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using Syst 阅读全文
posted @ 2021-09-15 09:27 荣超 阅读(330) 评论(0) 推荐(0) 编辑
摘要:1、下载dll文件 下载地址 https://sourceforge.net/projects/moonpdf/files/MoonPdf-0.3.0/ 我这里下载的32位的 64位的网络错误一直下载不下来 下载后就能获取到需要的dll文件了 然后添加引用 右键引用 点击添加引用 只需要添加 Moo 阅读全文
posted @ 2021-09-03 09:11 荣超 阅读(1635) 评论(0) 推荐(0) 编辑
摘要:需要继承System.Windows.Controls.UserControl类 使用System.Windows.DependencyProperty绑定属性 注意在自定义控件中 不要设置DataContext 默认就行 否则的话我们使用定义好的自定义控件时,使用动态绑定无效 我们如果使用其他类 阅读全文
posted @ 2021-09-03 08:57 荣超 阅读(1466) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示