摘要: 在按钮上鼠标右键,弹窗选择颜色: private void Btn_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { Button btn = sender as Button; // 选择颜色 int channelNum 阅读全文
posted @ 2026-05-27 10:22 nap117 阅读(2) 评论(0) 推荐(0)
摘要: ListBox中放了一个按钮,想要在右键操作时弹出一个包含多个控件的Popup,实现如下: XAML: <ListBox x:Name="MyList" ItemsSource="{Binding MyCollection}" ItemContainerStyle="{StaticResource 阅读全文
posted @ 2026-05-27 09:58 nap117 阅读(2) 评论(0) 推荐(0)
摘要: 安装SciChart的SDK,里面包含SciChart WPF v5 Licensing Wizard; 在项目引用中添加SCIChart的SDK: 运行SciChart WPF v5 Licensing Wizard,添加Development license。 在项目App.xaml.cs的初始 阅读全文
posted @ 2026-05-19 10:59 nap117 阅读(8) 评论(0) 推荐(0)
摘要: 科学计数法: <DataGridTextColumn Header="A" FontSize="10" Binding="{Binding CaliKey.Ka, StringFormat={}{0:E6}}" MinWidth="50"/> 浮点型小数位固定6位: <DataGridTextCol 阅读全文
posted @ 2026-04-29 14:44 nap117 阅读(3) 评论(0) 推荐(0)
摘要: 1.添加OxyPlot库; 2.Xaml中添加引用; xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf" 3.Xaml中使用控件; <oxy:PlotView x:Name="MyPlotView"/> 4.隐藏代码中 初始化图表 v 阅读全文
posted @ 2026-04-27 17:03 nap117 阅读(25) 评论(0) 推荐(0)
摘要: // Button btn = sender as Button; CalibrationKey samplePointXY = btn.DataContext as CalibrationKey; //DataGridRow row = FindVisualParent(btn); DataGri 阅读全文
posted @ 2026-04-14 17:48 nap117 阅读(3) 评论(0) 推荐(0)
摘要: ModbusSerialMaster modbusSerialMaster = null; SerialPort serialPort = null; string portName = _ViewModel.SerialPortName; // 替换为你的串口号 int baudRate = _V 阅读全文
posted @ 2026-04-14 16:23 nap117 阅读(2) 评论(0) 推荐(0)
摘要: 打开程序; 打开Hex程序文件:File--》Open File…… 开始烧写:Target-》Program 阅读全文
posted @ 2026-03-30 08:49 nap117 阅读(3) 评论(0) 推荐(0)