本文介绍了无法将类型'System.Windows.Forms.ProgressBar'隐式转换为'System.Windows.Forms.Button'和& System.Windows.Forms.FolderBrowserDialog”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在使用C#处理一个应用程序并在一行中 if(this._Button5!= null) this ._Button5.Click - = new EventHandler(this.Button5_Click); this._Button5 = WithEventsValue; 我有5个按钮&1我要分配给WithEventsValue的FolderbrowserDialog。 我收到的错误为 无法隐式转换类型'System.Windows.Forms.ProgressBar'到'System.Windows.Forms.Button' 无法将类型'System.Windows.Forms.ProgressBar'隐式转换为' System.Windows.Forms.FolderBrowserDialog' 先谢谢解决方案 你不能隐式地转换它们,但不能以任何其他方式转换它们。我不知道是什么让你试图进行这样的转换。你的代码示例没有显示任何相关的内容。 看,当你尝试编译任何东西时,编译器会给你确切的问题所在的行。而且你甚至没有显示这些行,表明每个案例的错误信息(更好的是以评论的形式)。当然,你需要展示足够的背景。 -SA Am working on an application using C# and am in a line that if (this._Button5 != null) this._Button5.Click -= new EventHandler(this.Button5_Click); this._Button5 = WithEventsValue;Am having 5 Buttons & 1 FolderbrowserDialog which I want to assign to WithEventsValue.Am getting error as "Cannot implicitly convert type 'System.Windows.Forms.ProgressBar' to 'System.Windows.Forms.Button'Cannot implicitly convert type 'System.Windows.Forms.ProgressBar' to 'System.Windows.Forms.FolderBrowserDialog'Thanks in Advance 解决方案 You cannot convert them not only implicitly, but in any other way. I have no idea what makes you trying to do such conversion. Your code sample does not show anything relevant.Look, when you try to compile anything, the compiler gives you exact line(s) where the problem is. And you don't even show these lines indicating error information on each case (better be in the form of comment). And of course you need to show sufficient context.—SA 这篇关于无法将类型'System.Windows.Forms.ProgressBar'隐式转换为'System.Windows.Forms.Button'和& System.Windows.Forms.FolderBrowserDialog”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-03 14:21