问题描述
在我自己设计的电脑上无问题。在别的电脑上出现这问题,实在不知道从何出下手解决问题,还请各位大虾帮忙,在此不盛感激。具体问题如下:出现在主窗口的InitializeComponent()函数中,VS提示信息如下:未处理System.ComponentModel.Win32ExceptionMessage="窗口类名无效。"Source="System.Windows.Forms"ErrorCode=-2147467259NativeErrorCode=0StackTrace:在System.Windows.Forms.NativeWindow.WindowClass.RegisterClass()在System.Windows.Forms.NativeWindow.WindowClass.Create(StringclassName,Int32classStyle)在System.Windows.Forms.NativeWindow.CreateHandle(CreateParamscp)在System.Windows.Forms.Control.CreateHandle()在System.Windows.Forms.Control.CreateControl(BooleanfIgnoreVisible)在System.Windows.Forms.Control.CreateControl(BooleanfIgnoreVisible)在System.Windows.Forms.Control.CreateControl(BooleanfIgnoreVisible)在System.Windows.Forms.Control.CreateControl(BooleanfIgnoreVisible)在System.Windows.Forms.Control.CreateControl()在System.Windows.Forms.Control.WmShowWindow(Message&m)在System.Windows.Forms.Control.WndProc(Message&m)在System.Windows.Forms.ScrollableControl.WndProc(Message&m)在System.Windows.Forms.ContainerControl.WndProc(Message&m)在System.Windows.Forms.Form.WmShowWindow(Message&m)在System.Windows.Forms.Form.WndProc(Message&m)在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&m)在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtrhWnd,Int32msg,IntPtrwparam,IntPtrlparam)在System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRefhWnd,Int32nCmdShow)在System.Windows.Forms.Control.SetVisibleCore(Booleanvalue)在System.Windows.Forms.Form.SetVisibleCore(Booleanvalue)在System.Windows.Forms.Control.set_Visible(Booleanvalue)在System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32reason,ApplicationContextcontext)在System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32reason,ApplicationContextcontext)在System.Windows.Forms.Application.Run(FormmainForm)在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DisplaySplash()在System.Threading.ThreadHelper.ThreadStart_Context(Objectstate)在System.Threading.ExecutionContext.runTryCode(ObjectuserData)在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCodecode,CleanupCodebackoutCode,ObjectuserData)在System.Threading.ExecutionContext.RunInternal(ExecutionContextexecutionContext,ContextCallbackcallback,Objectstate)在System.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,ContextCallbackcallback,Objectstate)在System.Threading.ThreadHelper.ThreadStart()
解决方案
解决方案二:
工程属性“启用XP视觉样式”要去掉。
解决方案三:
感谢,感谢!!!!!补充一下:软件运行在XP系统下,新PC使用的是华硕B85系列主板
解决方案四:
感谢Tiger_Zhao,我去试一下
解决方案五:
真的很感谢Tiger_Zhao我试过了,确实可以。但问题是什么原因遭成的呢?为什么在我设计用的PC机和笔记本电脑都可以,却在这个更新的,更好的PC上就不行呢?是缺少什么文件或多了什么文件吗,例如NetFrameWork3.0?请求Tiger_Zhao提供帮助????
解决方案六:
在XP上,好像是某些comctl32.dll的版本就会出这个错。
解决方案七:
在XP上,好像是某些comctl32.dll的版本就会出这个错。微软都不维护XP了,所以会去解决这个问题。
解决方案八:
很抱歉,这些天很忙没有及时回复。应该没错,我看到主要是TabControl控件和Button控件发生了主要变化,变化很难看。是否找到这些控件所在的dll,更换就可以呢。这里有个问题,怎样确定这些控件所在的dll。在UI设计中看到TabControl在FrameWork2.0中,不知道是否正确?
解决方案九:
换Win7,不要再用XP了。微软不维护,出问题后果自负(难看也只能难看了)。
解决方案十:
事情非如此,也并非不想换,但这里使用到了别人家的代码库。别人的没有支持WIN7,那能怎么样
解决方案十一:
路过学习了,
解决方案十二:
所以只能难看了。维护不下去就得开发新版本(找新的代码库、或自己开发),这是必然的过程。