摘要: 方式一、通过当前控件名获取父级窗体 Window targetWindow = Window.GetWindow(button); 方式二、通过当前控件获取父级窗体 Window parentWindow = Window.GetWindow(this); 方式三、类--Application Window mainwin = Application.Current.MainWin... 阅读全文
posted @ 2019-04-19 11:09 xunyiHe 阅读(1080) 评论(0) 推荐(0)
摘要: 1、RichTextBox扩展类 2、RichTextBox控件定义 3、事件处理 阅读全文
posted @ 2019-03-15 19:03 xunyiHe 阅读(2056) 评论(0) 推荐(0)
摘要: #region 控件保存为图片--放大图 /// /// 控件保存为图片--可处理放大图 /// /// /// public static Bitmap CreateNotRanderElementScreenshot(FrameworkElement element, ... 阅读全文
posted @ 2019-03-15 18:54 xunyiHe 阅读(1034) 评论(0) 推荐(0)
摘要: /// /// 区域--缩放 /// /// 缩放倍数 private void SetMatrix(double Multiple) { Grid printGrid = GetPrintGrid();//获取显示的面板 //背景图打印不显示 ... 阅读全文
posted @ 2019-03-15 18:43 xunyiHe 阅读(520) 评论(0) 推荐(0)
摘要: private SerialPort serialPort;//串口对象类 private string strPortDataReceived = "";//记录串口返回值 private string serialPortName = "";//记录端口号 private bool isGet = false; /// ... 阅读全文
posted @ 2019-03-15 18:24 xunyiHe 阅读(1454) 评论(0) 推荐(0)
摘要: // 画标尺 private void DrawRule(double scale)//scale缩放的倍数 { if (cvRuler.Children != null) { cvRuler.Children.Clear(); } System.Windows.Shapes.Line _line; 阅读全文
posted @ 2018-11-14 13:01 xunyiHe 阅读(4331) 评论(2) 推荐(0)
摘要: //获取scrollViewer的偏移量 private void scrollViewer1_ScrollChanged(object sender, ScrollChangedEventArgs e) { offsetValue = e.HorizontalOffset; border_Left 阅读全文
posted @ 2018-11-14 11:37 xunyiHe 阅读(1655) 评论(0) 推荐(0)
摘要: 初步效果图: xaml代码 <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d 阅读全文
posted @ 2018-07-25 10:06 xunyiHe 阅读(3924) 评论(0) 推荐(0)