- 博客(8)
- 收藏
- 关注
转载 WPF获取当前用户控件的父级窗体
方式一、通过当前控件名获取父级窗体Window targetWindow = Window.GetWindow(button);方式二、通过当前控件获取父级窗体Window parentWindow = Window.GetWindow(this);方式三、类--ApplicationWindow mainwin = Applicati...
2019-04-19 11:09:00
861
转载 WPF RichTextBox不自动换行
1、RichTextBox扩展类using System;using System.Collections.Generic;using System.Globalization;using System.Linq;using System.Text;using System.Windows.Documents;using System.Windows.Me...
2019-03-15 19:03:00
773
转载 WPF控件保存为图片Bitmap
#region 控件保存为图片--放大图 /// <summary> /// 控件保存为图片--可处理放大图 /// </summary> /// <param name="element"></param> /// <re...
2019-03-15 18:54:00
417
转载 WPF MatrixTransform无差别缩放面板
/// <summary> /// 区域--缩放 /// </summary> /// <param name="Multiple">缩放倍数</param> private void SetMatrix(double Multiple) ...
2019-03-15 18:43:00
285
转载 c# 循环com,分别对串口写入与读取,获取需要的串口信息
private SerialPort serialPort;//串口对象类 private string strPortDataReceived = "";//记录串口返回值 private string serialPortName = "";//记录端口号 private bool isGet = false;...
2019-03-15 18:24:00
613
转载 c# 画刻度尺(支持缩放)
// 画标尺 private void DrawRule(double scale)//scale缩放的倍数 { if (cvRuler.Children != null) { cvRuler.Children.Clear(); } S...
2018-11-14 13:01:00
1614
转载 WPF ScrollViewer偏移量设置
//获取scrollViewer的偏移量private void scrollViewer1_ScrollChanged(object sender, ScrollChangedEventArgs e) { offsetValue = e.HorizontalOffset; border_Left.Margin = new T...
2018-11-14 11:37:00
728
转载 WPF 自定义表格(可添加、删除、合并、拆分)
初步效果图:xaml代码<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas....
2018-07-25 10:06:00
1072
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人