07 2019 档案
摘要:第一内部资源: pack://application:,,,/images/my.jpg 第二 外部程序资源: pack://SiteOfOrigin:,,,/images/my.jpg 需要将资源放于运行目录
阅读全文
摘要:object obItem=this.FindResource("canvasdt"); if (obItem is System.Windows.DataTemplate) { System.Windows.DataTemplate getDtemplate = obItem as System.
阅读全文
摘要:dg.SmoothingMode = SmoothingMode.HighSpeed; //高质量 dg.PixelOffsetMode = PixelOffsetMode.HighSpeed; //高像素偏移质量 dg.CompositingQuality = CompositingQuality
阅读全文
摘要:一: protected override void OnKeyDown(KeyEventArgs e) { if (e.Key==Key.Enter) { sendAppToServer(); } base.OnKeyDown(e); } 二; 下面为监听方向键: protected overri
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace Wolfy.LinqAggregation{ class
阅读全文
摘要:QRect screenRect = QGuiApplication::primaryScreen()->geometry(); double devicePixelRatio = QGuiApplication::primaryScreen()->devicePixelRatio(); int s
阅读全文
摘要:QFont font(androidFont); QFontInfo fInfo(font); qDebug()<<"FFFFFFFFFFFFFFFFFFFFFFFPPPSIZE::"<<fInfo.pixelSize();
阅读全文
摘要:Html互转: string c1 = System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color.Red); System.Drawing.Color c2 = System.Drawing.ColorTranslator.FromHtml
阅读全文
摘要://获取日期+时间 DateTime.Now.ToString(); // 2008-9-4 20:02:10 DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12 //获取日期 DateTime.Now.ToLongDateStri
阅读全文
摘要:private string ConvertJsonString(string str) { //格式化json字符串 JsonSerializer serializer = new JsonSerializer(); TextReader tr = new StringReader(str); J
阅读全文
摘要:添加缓冲: private void SetDoubleBuffer() { base.SetStyle( ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | Co
阅读全文
摘要:首先说明一个示例,分析一下Filter属性的构成:“ Excel文件|*.xls ”,前面的“Excel文件”成为标签,是一个可读的字符串,可以自定定义,“|*.xls”是筛选器,表示筛选文件夹中后缀名为.xls的文件,“*”表示匹配Excel文件名称的字符串。OK,下面说说我们经常要用到的几种情况
阅读全文
摘要:public void FileCopy(string source, string target) { using (FileStream fileRead = new FileStream(source, FileMode.Open, FileAccess.Read,FileShare.Read
阅读全文
摘要:QByteArray在串口通讯中经常被使用,有一定必要较为全面详细的对QByteArray进行阐述。本文通过以下几个部分加以介绍: 1. 初始化 2. 访问与赋值 3. 添加、删除、插入与替换操作 4. 查找与比较 5. 数据转换与处理 1 初始化 2 访问与赋值 访问QByteArray主要有4中
阅读全文
摘要:string path = "test.txt"; FileStream mystream = new FileStream(path, FileMode.OpenOrCreate); StreamWriter myWrite = new StreamWriter(mystream); myWrit
阅读全文
摘要:System.Math.Abs(float value); System.Math.Abs(decimal value); System.Math.Abs(int value); System.Math.Abs(double value); System.Math.Abs(sbyte value);
阅读全文
摘要:private string ConvertStringToJson(string str) { //格式化json字符串 JsonSerializer serializer = new JsonSerializer(); TextReader tr = new StringReader(str);
阅读全文