Datagridview的BUG?

xieshy 2011-09-14 10:46:44
//以下Exception一直无从下手捕捉,请教各路高手。
//只要启用了DATAGRIDVIEW的ShowCellToolTips=True,按Esc键退出窗口(窗体的CacelButton指定某一Button,该Button的Click事件只有一句"this.Close();")便会出现以下Exception

System.InvalidOperationException: Window handle already exists.
at System.Windows.Forms.NativeWindow.CheckReleased()
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.ToolTip.CreateHandle()
at System.Windows.Forms.ToolTip.Hide(IWin32Window win)
at System.Windows.Forms.DataGridView.DataGridViewToolTip.Activate(Boolean activate)
at System.Windows.Forms.DataGridView.OnMouseLeave(EventArgs e)
at System.Windows.Forms.Control.WmMouseLeave(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.DataGridView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ANDY.Program.Main(String[] args) in D:\Projects\ABC\Program.cs:line 33
...全文
68 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xieshy 2011-09-14
  • 打赏
  • 举报
回复
必需用到。难道仙人要做到

吃饭 》牙痛

为了不牙痛,所以不吃饭

Ny-6000 2011-09-14
  • 打赏
  • 举报
回复
那就不启用了罢.

111,119

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧