X3

RedSky

导航

2021年6月24日 #

WPF窗体透明Win7,Win10不同处理方法

摘要: 直接上代码: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); WindowStyle = WindowStyle.None; if (IsWindows8x()) { Re 阅读全文

posted @ 2021-06-24 18:01 HotSky 阅读(262) 评论(0) 推荐(0)

2021年6月21日 #

WPF颜色选择控件

摘要: 效果图: cs: 1 /// <summary> 2 /// ColorPick.xaml 的交互逻辑 3 /// </summary> 4 public partial class ColorPick : UserControl 5 { 6 ChangeSource _changeSource; 阅读全文

posted @ 2021-06-21 10:16 HotSky 阅读(517) 评论(0) 推荐(0)

2021年6月9日 #

WPF ContextMenu绑定

摘要: <Window DataContext="{Binding MyViewModelInstance}"> <ListBox ItemsSource="{Binding MyDataItems}"> <ListBox.ContextMenu> <ContextMenu DataContext="{Bi 阅读全文

posted @ 2021-06-09 15:46 HotSky 阅读(496) 评论(0) 推荐(0)

2021年3月2日 #

C#获取文件MD5

摘要: public static string GetFileMD5(string filePath) { using (FileStream fs = new FileStream(filePath, FileMode.Open)) { System.Security.Cryptography.MD5C 阅读全文

posted @ 2021-03-02 09:25 HotSky 阅读(309) 评论(0) 推荐(0)

2020年9月2日 #

WPF点连成曲线,贝塞尔曲线两种画法

摘要: 先看效果图: 黑色是需要经过的点; 黄色为控制点; 绿色为两点之间的中点。 方式一: 方式二: <Canvas x:Name="canvas2"/> 方法一代码,【这是别人的代码,时间久了忘记原出处了】: Path path; public void UpdateRoad(List<Point> l 阅读全文

posted @ 2020-09-02 10:49 HotSky 阅读(2284) 评论(0) 推荐(0)

2020年6月2日 #

WPF TextBox输入限制,只能输入数字,字母

摘要: private void Tb_PreviewKeyDown(object sender, KeyEventArgs e) { bool isNumber = e.Key >= Key.D0 && e.Key <= Key.D9 || e.Key >= Key.NumPad0 && e.Key <= 阅读全文

posted @ 2020-06-02 11:28 HotSky 阅读(1812) 评论(0) 推荐(0)

2020年5月13日 #

c# ActiveMQ的使用

摘要: /// <sumary>/// 接收方/// </sumary>public void StartClient() { var factory = new NMSConnectionFactory(new Uri("activemq:failover:(tcp://localhost:61616/? 阅读全文

posted @ 2020-05-13 14:38 HotSky 阅读(746) 评论(0) 推荐(0)

WPF将窗体设置为桌面背景【动态桌面】

摘要: #region MyRegion private IntPtr programIntPtr = IntPtr.Zero; bool inited { get; set; } public void Init() { try { if (inited) return; // 通过类名查找一个窗口,返回 阅读全文

posted @ 2020-05-13 10:32 HotSky 阅读(1089) 评论(0) 推荐(0)

2020年1月14日 #

WPF Canvas子控件拖拽行为,以及ListBox+Canvas场景

摘要: 1 public class DragMoveBehavior : Behavior<UIElement> { Window window; Canvas parent; bool isDown; Point prePosition = new Point(); public Type Target 阅读全文

posted @ 2020-01-14 17:48 HotSky 阅读(1086) 评论(2) 推荐(1)

2019年12月14日 #

BitmapSource

摘要: 来自:https://stackoverflow.com/questions/8311805/bitmapsource-copypixels-byte-bitmapsource-how-to-do-this-simple 阅读全文

posted @ 2019-12-14 17:28 HotSky 阅读(614) 评论(0) 推荐(0)