求救:上下键控制菜单发生异常
一个很奇怪的问题。在网上搜索了好久,好像都没有人遇上过。我有个WinForm程序,用了stripMenu做菜单,设了些加速键,用鼠标控制菜单的时候完全没有问题。用键盘的加速键比如&File用ALT+F都没有问题,但是就是用上下键得时候抛出异常。想去debug,但是苦于这种情况下完全不知道如何设置断点,按下上下键的时候会触发的代码不知道如何寻找。请大家帮帮忙,这里抛出的异常信息是:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArithmeticException: Overflow or underflow in the arithmetic operation.
at System.Windows.Forms.ToolStrip.GetNextItemVertical(ToolStripItem selectedItem, Boolean down)
at System.Windows.Forms.ToolStrip.GetNextItem(ToolStripItem start, ArrowDirection direction)
at System.Windows.Forms.ToolStrip.ProcessArrowKey(Keys keyCode)
at System.Windows.Forms.ToolStripDropDown.ProcessArrowKey(Keys keyCode)
at System.Windows.Forms.ToolStrip.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.ToolStripDropDown.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MeappDebugger
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/SeekerWorld/SeekersWorld/MeappDebugger/MeappDebugger/bin/Debug/MeappDebugger.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
MeappRunnerWrapper
Assembly Version: 1.0.3086.18663
Win32 Version:
CodeBase: file:///D:/SeekerWorld/SeekersWorld/MeappDebugger/MeappDebugger/bin/Debug/MeappRunnerWrapper.DLL
----------------------------------------
msvcm90d
Assembly Version: 9.0.21022.8
Win32 Version: 9.00.21022.8
CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456/msvcm90d.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
CommandTextBox
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/SeekerWorld/SeekersWorld/MeappDebugger/MeappDebugger/bin/Debug/CommandTextBox.DLL
----------------------------------------
LucidPanel
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/SeekerWorld/SeekersWorld/MeappDebugger/MeappDebugger/bin/Debug/LucidPanel.DLL
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.21022.8 built by: RTM
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box. --------------------编程问答-------------------- 从来 没有遇到过。看来比较麻烦。
--------------------编程问答-------------------- 贴代码出来 --------------------编程问答-------------------- 报出的错误是越界错误,你检查一下你的菜单项目吧。在MenuStrip控件中有Keydown、KeyUp事件,你可以在这些事件中进行断点跟踪。 --------------------编程问答-------------------- 好像你的问题不是出在程序上 --------------------编程问答-------------------- 我也觉得不想是程序上的问题。但是实在不知道如何下手去解决这个问题!Keydown, keyup都还没触发就抛出异常了!完全调试不了。救命大伙门>.<
补充:.NET技术 , C#