摘要: 当没有focus在listbox时,selectedItem的background为灰色,只有鼠标点击之后才会变成蓝色。希望即使鼠标没有点击的时候也是蓝色。 解决方法: 在xaml中添加: 或在app.xaml中添加: 参考: https://social.msdn.microsoft.com/Fo 阅读全文
posted @ 2016-03-29 11:31 Jane&Coding 阅读(345) 评论(0) 推荐(0)
摘要: Window.ShowDialog() 返回值为bool?。希望在窗口点击OK时返回True。 解决方法: ShowDialog()的注释为: // Returns: // A System.Nullable<T> value of type System.Boolean that specifie 阅读全文
posted @ 2016-03-28 18:28 Jane&Coding 阅读(3503) 评论(0) 推荐(0)
摘要: 网上查找原因说是vs2012生成的exe只支持win7以上的系统。 解决: 1.build为x86 2.将.net 45 改为 .net 4 3.将.sln文件中 Microsoft Visual Studio Solution File, Format Version 12.00# Visual 阅读全文
posted @ 2016-03-28 10:42 Jane&Coding 阅读(804) 评论(0) 推荐(0)
摘要: ProjectData.cs: [Serializable] public class ProjectData : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; } Executo 阅读全文
posted @ 2016-03-22 14:59 Jane&Coding 阅读(1101) 评论(0) 推荐(1)
摘要: 想在一个textbox中输入日期,但要求只能输入数字,而且textbox中显示格式为XXXX-XX-XX。发现MaskedTextBox可以实现,但需要引用WPFToolkit。 References: 添加dll。(稍后说怎么添加) xaml: 添加引用: xmlns:s="clr-namespa 阅读全文
posted @ 2016-03-21 16:31 Jane&Coding 阅读(706) 评论(0) 推荐(0)
摘要: 想让Window的标题显示正在操作的文件名。 xaml: cs: 或: 更新: 由于几个子窗口中也需要显示文件名称,如果每个window都要上面一段代码,而且如果filename有变动会比较麻烦。所以又将FileName放在了一个类里: Executor.cs: MainWindow.xaml: M 阅读全文
posted @ 2016-03-18 11:11 Jane&Coding 阅读(1040) 评论(0) 推荐(0)
摘要: 今天为了这个错误折腾了半天,Exclude各种window和userControl,以为是哪个窗口有问题,却没有仔细阅读错误信息....... 这个错误就是因为我勤劳的把MainWindow.xaml拖到了Folder中,但是App.xaml中却依然是StartupUri="MainWindow.x 阅读全文
posted @ 2016-03-17 16:54 Jane&Coding 阅读(1030) 评论(0) 推荐(0)
摘要: 在写一个很简单的控制台程序时遇到错误 解决办法: 阅读全文
posted @ 2016-02-16 16:11 Jane&Coding 阅读(636) 评论(0) 推荐(0)
摘要: string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1\"";OleDbConnection conn... 阅读全文
posted @ 2015-12-30 14:18 Jane&Coding 阅读(252) 评论(0) 推荐(0)
摘要: class Program { static void Main(string[] args) { ParentClass test = new SubClass(); test.doSomething();/*结果:Pa... 阅读全文
posted @ 2015-12-11 16:45 Jane&Coding 阅读(169) 评论(0) 推荐(0)