随笔分类 -  WPF

摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Windows; usin 阅读全文
posted @ 2021-07-15 17:10 马肯尼煤牙巴骨 阅读(56) 评论(0) 推荐(0) 编辑
摘要:public static Point[] GetIntersectionPoints(Geometry g1, Geometry g2) { Geometry og1 = g1.GetWidenedPathGeometry(new Pen(Brushes.Black, 1.0)); Geometr 阅读全文
posted @ 2020-12-28 17:24 马肯尼煤牙巴骨 阅读(82) 评论(0) 推荐(0) 编辑
摘要:wpf根据硬件 可以做出三档的渲染 dx7以下 第0档 不支持硬件加速 dx7-dx9 第1档, 不支持所有硬件加速,但支持一部分 dx9 以上 支持所有硬件加速 可以用编程的方式取代 当前设备处于哪一个渲染级别 阅读全文
posted @ 2019-10-18 09:44 马肯尼煤牙巴骨 阅读(791) 评论(0) 推荐(0) 编辑
摘要:in the case you can do it to fix: 阅读全文
posted @ 2019-09-25 18:00 马肯尼煤牙巴骨 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Products = new ObservableCollection<Product>(products); ProductOptions = new ObservableCollection<ProductOption>(options); ProductsView = CollectionVi 阅读全文
posted @ 2019-07-27 01:10 马肯尼煤牙巴骨 阅读(560) 评论(0) 推荐(0) 编辑
摘要:xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" xmlns:swd="clr-namespace:System.Windows.Data;assembly=PresentationFramework" <Col 阅读全文
posted @ 2019-07-27 01:03 马肯尼煤牙巴骨 阅读(622) 评论(0) 推荐(0) 编辑
摘要:void window_KeyDown(object sender,KeyEventArgs e) { if(e.Key == Key.F11) { Window.ResizeMode = ResizeMode.NoResize; Window.WindowState = WindowState.N 阅读全文
posted @ 2019-07-26 16:39 马肯尼煤牙巴骨 阅读(191) 评论(0) 推荐(0) 编辑
摘要:1.在scrollview 中的frameworkelement可以使用 FE.BringIntoView(); 滚动到此控件. 2.该 方法能一个重载 Bottom.BringIntoView(new Rect(0, 0, 5, 5)); 当控件比scrollview尺寸大时,可以让scrollv 阅读全文
posted @ 2019-07-25 17:17 马肯尼煤牙巴骨 阅读(384) 评论(0) 推荐(0) 编辑
摘要:private void StackPanel_MouseMove(object sender, MouseEventArgs e) { Debug.WriteLine("Move"); Point spRel = e.GetPosition((IInputElement)e.OriginalSou 阅读全文
posted @ 2019-07-25 16:58 马肯尼煤牙巴骨 阅读(311) 评论(0) 推荐(0) 编辑
摘要:private void Parallel(object sender, RoutedEventArgs e) { Task.Run(() => ChangeColour(Brushes.Red)); } private void Standard(object sender, RoutedEventArgs e) { ChangeColour(Brushes.Green);... 阅读全文
posted @ 2019-07-24 20:58 马肯尼煤牙巴骨 阅读(839) 评论(0) 推荐(0) 编辑
摘要:private IntPtr WidProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == 0x112) { if (wParam.ToInt32() == 0xF0... 阅读全文
posted @ 2019-06-05 16:59 马肯尼煤牙巴骨 阅读(330) 评论(0) 推荐(0) 编辑
摘要:https://blog.walterlv.com/post/windows-high-dpi-development.html https://blog.csdn.net/ZslLoveMiwa/article/details/81294311 https://blog.csdn.net/blea 阅读全文
posted @ 2019-05-16 16:09 马肯尼煤牙巴骨 阅读(348) 评论(0) 推荐(0) 编辑
摘要:Install-Package Microsoft.Xaml.Behaviors.Wpf 阅读全文
posted @ 2019-04-15 10:50 马肯尼煤牙巴骨 阅读(845) 评论(1) 推荐(0) 编辑
摘要:private void Button_Click(object sender, RoutedEventArgs e) { string savePth = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "richtextboxData.data"); ... 阅读全文
posted @ 2019-04-09 15:18 马肯尼煤牙巴骨 阅读(406) 评论(0) 推荐(0) 编辑
摘要:public class VirtualizingWrapPanel : VirtualizingPanel, IScrollInfo { #region Fields UIElementCollection _children; ItemsControl _itemsControl; IItemContaine... 阅读全文
posted @ 2019-04-09 11:31 马肯尼煤牙巴骨 阅读(183) 评论(2) 推荐(0) 编辑
摘要:1. 声明静态事件 2.静态属性 setter 3. xmal 这里比较重要, 要加括号 不然不能正常通知 甚至编译时异常 T-T 4. 只有.net frameWork 4.5以上才有这个功能, 阅读全文
posted @ 2019-03-17 17:43 马肯尼煤牙巴骨 阅读(678) 评论(0) 推荐(1) 编辑
摘要:#region WPF发送和接收win32消息 public const int WM_GETTEXT = 0x0D; public const int WM_SETTEXT = 0x0C; public const int WM_SIZEING = 0x0214; public const int WM_COPYDATA = 0x... 阅读全文
posted @ 2019-03-07 11:30 马肯尼煤牙巴骨 阅读(688) 评论(2) 推荐(0) 编辑
摘要:这是一个比较偏的功能,看了其他的很多博客都没有介绍,最后看自己试出来了. 先上效果图 目前还不知道怎么把蚂蚁线中的 图形从 dashed(-) 改成arrow(箭头) 或其他图形. 如果谁有优雅的方法请麻烦分享一下 ^ ^ 阅读全文
posted @ 2019-02-25 14:41 马肯尼煤牙巴骨 阅读(1283) 评论(0) 推荐(2) 编辑
摘要:JS调用C#代码 HTML代码: WPF代码中的C#代码: WPF和JavaScript之间的通信需要完全信任,因此您需要添加以下代码: 也经常这么干 c#调用 JS方法 myscripts.js: 阅读全文
posted @ 2019-02-22 11:17 马肯尼煤牙巴骨 阅读(867) 评论(1) 推荐(0) 编辑
摘要:Event handlers leak This type of leak occurs when subscribing an object (let's call it listener) to an event of some other object (let's call it sourc 阅读全文
posted @ 2019-01-21 18:24 马肯尼煤牙巴骨 阅读(400) 评论(0) 推荐(0) 编辑

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