- 博客(17)
- 收藏
- 关注
原创 后台cs 设置DataGrid样式 new style
private void DataGrid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e){ Style style = this.Resources["cellStyle"] as Style; //Style cellStyle = new Style(typeof(Da...
2020-04-08 15:46:49
297
原创 SQL SERVER查询结果添加行号
SELECT ( Row_Number() over( ORDER BY PathologyID )) AS RowNo,PathologyID,FrozenReportDr,FrozenExamineDr,FrozenCoincidence,FrozenReportTime from Pitaya_FrozenReport where 1=1 and FrozenReceiveDate BE...
2020-01-05 18:02:13
4016
原创 计算 代码执行的时间
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();watch.Start();//执行的代码watch.Stop();TimeSpan timespan = watch.Elapsed;var time = timespan.TotalMilliseconds;
2019-11-01 11:08:20
192
原创 定时器
DispatcherTimer timer = new DispatcherTimer();timer.Interval = TimeSpan.FromSeconds(5);timer.Tick += timer_Tick;timer.Start();private void timer_Tick(object sender, EventArgs e){ NoExecuteTex...
2019-11-01 11:01:26
125
原创 Action的一个使用场景
多个父界面local 另一界面,子界面中的点击事件需要调用父界面中的查询函数,不同的父中的查询函数不一样。父1 ocal 子界面,子界面则调用父1的查询函数;父2 local子界面,子界面则调用父2的查询函数GridEmbedControl.xaml<Grid> <Viewbox Stretch="Fill"> <Border Wi...
2019-11-01 10:47:39
333
原创 委托与事件 的一个使用场景
被调用的UI,修改后,改变父界面控件的值HostWindow.cs(父界面)public partial class HostWindow : BaseWindow{public HostWindow(AppContext Context) : base(Context){DataContext = new HostWindowViewModel(Conte...
2019-11-01 10:21:59
490
原创 引用与命名空间
xmlns:local="clr-namespace:Geoway.GDC.Viewer.Frame" 该xaml文件同在Geoway.GDC.Viewer.Frame空间中,需引用同一空间中其他文件<Grid Grid.Row="0" Name="Data_Drill"> <local:DataContent_Drill></ss:Dat...
2019-07-29 11:29:54
168
原创 WPF TextBox 添加Enter事件与数据双向绑定的问题
键盘按下Enter键时触发事件。TextBox虽然双向绑定到CurrentPageNumber,但是Enter事件触发时,此时焦点还在textbox上时,后台CurrentPageNumber 的值仍未动态更新(双向绑定未触发)。解决办法Text="{Binding CurrentPageNumber, UpdateSourceTrigger=PropertyChanged}" ,Enter事件触...
2019-07-24 10:57:24
4968
2
原创 C# 获取父对象和子对象
public class FormUtil { public static T GetParentObject<T>(DependencyObject obj, string name) where T : FrameworkElement { DependencyObject parent = VisualTreeHe...
2019-07-03 15:18:41
2673
原创 WPF auto 与 *
使用自动尺寸设置方式,可使用Auto值。表示自动适应显示内容的宽度, 如文本需要多长,控件就显示多长.如果存在显示不全的问题,就会截断显示。<RowDefinition Height="Auto"></RowDefinition>按比例尺寸设置方式,需要使用星号(*)<RowDefinition Height="*"></RowDefiniti...
2019-07-02 16:33:06
929
转载 记录几个好用的网址
在线格式转换 https://tableconvert.com/ 经纬度查询网址 http://www.gpsspg.com/maps.htm 使用各种 WPF Chart图表控件、插件的经历回顾与总结https://blog.youkuaiyun.com/qq_42125932/article/details/823502934. Prism中文文档 https://www.cnblogs....
2019-07-02 14:33:58
1084
转载 WPF如何让时间控件精确到时分秒
嵌套WinForm控件:引用WindowsFormsIntegration页首:xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"xmlns:wf="clr-namespace:System.Windows.Forms;assembly=S...
2019-06-25 19:01:27
3371
转载 C# 如何测试代码运行时间
转载https://www.cnblogs.com/ZCoding/p/4274026.html第一种方式:System.Diagnostics.Stopwatch stopwatch = new Stopwatch();stopwatch.Start(); // 开始监视代码运行时间// 需要测试的代码 ....stopwatch.Stop(); // 停止监视Time...
2019-06-20 16:17:17
516
原创 C# 引用SQLite
创建C#项目,添加SQLite引用: 右键引用--管理NuGet程序包;在搜索框中输入sqlite,选择下载System.Data.SQLite。 下载完成后,引用目录将 自动添加以下引用, System.Data.SQLite System.Data.SQLite.EF6 System.Data.SQLite.Linqcs文件中对应添加using就可以使...
2019-06-19 16:04:05
2335
原创 在Windows上安装SQLite
1. 从官方网站上windows区域下载以下2个文件,网站 https://www.sqlite.org/download.htmlsqlite-dll-win32-x86-3280000.zipsqlite-tools-win32-x86-3280000.zip2. 解压上面2个文件,将解压出来的5个文件拷贝到,文件夹C:\sqlite下3. 添加PATH环境变量(右键我的电脑 -- 属...
2019-06-19 11:41:28
540
原创 C# 读取Excel数据
using Excel = Microsoft.Office.Interop.Excel;void GetDataFromExcelByCom() { System.Windows.Forms.OpenFileDialog openFile = new System.Windows.Forms.OpenFileDialog(); ...
2019-06-19 09:55:14
487
原创 C# openfiledialog文件单选和多选
System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog(); openFileDialog.Filter = "DataBank(*.xml)|*.xml|全部文件(*.*)|*.*";openFileDialog.Multiselect = ...
2019-06-18 11:57:26
7385
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人