07 2022 档案
摘要:WPF 窗口大小自适应 在设置桌面不同分辨率以及较大DPI下,窗口如何显示的问题。 方案一 设置窗口最大值和最小值显示 通过对比当前屏幕的可显示区域,将窗口高宽最大值和最小值,设置为窗口的实际高宽(此例中仅设置高度) 界面设置 设置窗口内容自适应SizeToContent="WidthAndHeig
阅读全文
摘要:<Window.Resources> </Window.Resources>
阅读全文
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.
阅读全文
摘要:public void TestA() { int time = 1658310821; string str = time.ToString("X4"); byte[] testb = strToHexByte(str); } /// <summary> /// 16进制字符串转换成16进制byt
阅读全文
摘要:public void Test() { byte[] results = new byte[1]; results[0] = 0xff; int temp = results[0]; byte b = SetBit(results[0], 7, 0); Console.WriteLine(b);
阅读全文
摘要:/// /// 获取字节中的指定Bit的值 /// /// 字节 /// Bit的索引值(0-7) /// public int GetBit(byte test, int index) { byte x = 1; switch (index) { case 0: { x = 0x01; } bre
阅读全文