WPF PasswordBox鼠标进入时程序异常退出的解决办法
最近在开发了一个程序中用到了PasswordBox控件,但是在程序给别人用的时候,鼠标一进入控件时程序就异常退出,查了下windows日志,错误显示如下:
应用程序: WpfPasswordTest2.exe
Framework 版本: v4.0.30319
说明: 应用程序通过 System.Environment.FailFast(string message) 请求终止进程。
消息: 不可恢复的系统错误。
堆栈:
在 System.Environment.FailFast(System.String)
在 MS.Internal.Invariant.FailFast(System.String, System.String)
在 MS.Internal.Invariant.Assert(Boolean)
在 System.Windows.Media.FontFamily.get_FirstFontFamily()
在 System.Windows.Media.FontFamily.get_LineSpacing()
在 System.Windows.Documents.TextSelection.CalculateCaretRectangle(System.Windows.Documents.ITextSelection, System.Windows.Documents.ITextPointer)
在 System.Windows.Documents.TextSelection.UpdateCaretStateWorker(System.Object)
在 System.Windows.Documents.TextSelection.UpdateCaretState(System.Windows.Documents.CaretScrollMethod)
在 System.Windows.Documents.TextSelection.EnsureCaret(Boolean, Boolean, System.Windows.Documents.CaretScrollMethod)
在 System.Windows.Documents.TextSelection.System.Windows.Documents.ITextSelection.UpdateCaretAndHighlight()
在 System.Windows.Documents.TextEditor.OnGotKeyboardFocus(System.Object, System.Windows.Input.KeyboardFocusChangedEventArgs)
在 System.Windows.Controls.PasswordBox.OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs)
在 System.Windows.UIElement.OnGotKeyboardFocusThunk(System.Object, System.Windows.Input.KeyboardFocusChangedEventArgs)
在 System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(System.Delegate, System.Object)
在 System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
在 System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
在 System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
在 System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
在 System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
在 System.Windows.Input.InputManager.ProcessStagingArea()
在 System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
在 System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject, Int32)
在 System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject, System.Windows.Input.IKeyboardInputProvider, Boolean, Boolean, Boolean)
在 System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject, Boolean, Boolean, Boolean)
在 System.Windows.Input.KeyboardDevice.Focus(System.Windows.IInputElement)
在 System.Windows.UIElement.Focus()
在 System.Windows.Documents.TextEditorMouse.MoveFocusToUiScope(System.Windows.Documents.TextEditor)
在 System.Windows.Documents.TextEditorMouse.OnMouseDown(System.Object, System.Windows.Input.MouseButtonEventArgs)
在 System.Windows.Controls.PasswordBox.OnMouseDown(System.Windows.Input.MouseButtonEventArgs)
在 System.Windows.UIElement.OnMouseDownThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
在 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
在 System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
在 System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
在 System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
在 System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
在 System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
在 System.Windows.Input.InputManager.ProcessStagingArea()
在 System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
在 System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
在 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
在 MS.Win32.UnsafeNativ
后面经查证,是由于系统字体的原因,具体的解决办法如下:
1.在一台正常运行passwordbox控件的电脑中,拷贝C:\Windows\Fonts下的所有文件
2.将拷贝的文件复制到C:\Windows\Fonts下,提示安装,选择全部覆盖安装即可。
3.重新运行程序,发现这个问题已经解决了。
WPF PasswordBox鼠标进入时程序异常退出的解决办法的更多相关文章
- android捕获程序异常退出
今天看到迅雷动漫里面一个CrashHandler 的类,我猜是崩溃处理类.进去一看.果然.顺便学习一下. Android系统的"程序异常退出",给应用的用户体验造成不良影响.为了捕 ...
- Android系统的“程序异常退出”[转]
在应用运行过程中,有很多异常可能会发生,而我们希望在异常发生的时候第一时间的保存现场. 如何处理未捕获的异常呢? 首先我们要实现一个接口 java.lang.Thread.UncaughtExcep ...
- 程序异常退出 却没有产生core文件
程序异常退出 却没有产生core文件 http://www.cnblogs.com/my_life/articles/4107333.html
- Linux C程序异常退出怎么办——core文件帮你忙
Linux C程序异常退出怎么办——core文件帮你忙 http://blog.csdn.net/zhu2695/article/details/51512138
- main()如果返回0,则代表程序正常退出,返回非零代表程序异常退出。
读到这里,大家应该了解了main函数返回值的来龙去脉了.下面介绍一下main函数返回值的作用以及如何获得这个返回值.main函数的返回值用于说明程序的退出状态.如果返回0,则代表程序正常退出.返回其它 ...
- .NETCore在析构函数(Finalize)在Linux下引起程序异常退出现象
目 录 1. 现象概述... 1 2. 操作数据库的代码... 2 3. 引起的异常... 2 4. 异常信息分析... 3 5. 分析结 ...
- 爬虫爬数据时,post数据乱码解决办法
最近在写一个爬虫,目标网站是:http://zx.bjmemc.com.cn/,可能是为了防止被爬取数据,它给自身数据加了密.用谷歌自带的抓包工具也不能捕获到数据.于是下了Fiddler. F ...
- HttpClient的CircularRedirectException异常原因及解决办法
HttpClient的CircularRedirectException异常原因及解决办法 这两天在使用我自己爬虫抓取网页的时候总是出现 org.apache.http.client.ClientPr ...
- oracle执行update语句时卡住问题分析及解决办法
转载:http://www.jb51.net/article/125754.htm 这篇文章主要介绍了oracle执行update语句时卡住问题分析及解决办法,涉及记录锁等相关知识,具有一定参考价值, ...
随机推荐
- linux 配置 skywalking
linux安装elasticsearch 一.检测是否已经安装的elasticsearch ps -aux|grep elasticsearch 二.下载elasticsearch (1)下载网站为: ...
- Linux 开启端口,操作防火墙
命令行方式: 添加10002端口方法 1.vi etc/sysconfig/iptables 2. 开放端口命令:-A INPUT -p tcp -m state --state NEW -m ...
- 单例模式(Mongo对象的创建)
单例模式: 饿汉式单例 //饿汉式单例类.在类初始化时,已经自行实例化 public class Singleton1 { //私有的默认构造子 private Singleton1() {} //已 ...
- 随机生成指定长度的密码之---Random
随机生成指定长度的密码思路: 1.密码中可能包含字母,数字,特殊符号,为了区别分别定义常量 2.随机生成密码,自然想到要用到java.util.Random 类 3.定义一个带两个参数的方法,1跟2, ...
- reduce python 的用法
1.查看reduce 的用法 在python 命令查看 import functools help(functools) help(functools.reduce) 或者 from functool ...
- import org.marker.weixin.DefaultSession; import org.marker.weixin.HandleMessageAdapter; import org.marker.weixin.MySecurity; import org.marker.weixin.msg.*;
需要以下微信包可以添加我的微信公众号 回复“微信api”即可得到jar链接,以及maven添加本地jar方法,以及更改后的源代码 import org.marker.weixin.DefaultSes ...
- Win8+VS2012 配置OpenGL SuperBible5 环境
(1)glew: 版本:1.7.0-win32 下载地址:https://sourceforge.net/projects/glew/files/glew/ 安装步骤: 将include文件夹下的.h ...
- git功能速查
http://gitbook.liuhui998.com/index.html git rebase:在本地变基.将本地所有的修改应用到另一个分支上 git merge:在本地合并分支 git bra ...
- BZOJ 4868-4873 题解
BZOJ4868 每个结束位置的最优值很显然具有单调性,三分,再讨论一下就好了. #include<bits/stdc++.h> using namespace std; #define ...
- hihocoder hiho第38周: 二分·二分答案 (二分搜索算法应用:二分搜索值+bfs判断可行性 )
题目1 : 二分·二分答案 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 在上一回和上上回里我们知道Nettle在玩<艦これ>,Nettle在整理好舰队之后 ...