日期:2014-05-18  浏览次数:21047 次

动态创建BUTTON控件出错!
以下为异常信息:
Type : System.ComponentModel.Win32Exception, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : 创建窗口句柄时出错。
Source : System.Windows.Forms
Help link : 
NativeErrorCode : 1158
ErrorCode : -2147467259
Data : System.Collections.ListDictionaryInternal
TargetSite : Void CreateHandle(System.Windows.Forms.CreateParams)
Stack Trace : 在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
  在 System.Windows.Forms.Control.CreateHandle()
  在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  在 System.Windows.Forms.Control.CreateControl()
  在 System.Windows.Forms.Control.ControlCollection.Add(Control value)
  在 (这里是程序中的方法)

------解决方案--------------------
把你创建控件的代码贴出来。
你是不是屏蔽了base.WndProc函数?
------解决方案--------------------
把出错代码贴上来吧