无法将类型'System.Windows.Forms.ProgressBar'隐式转换为'System.Windows.Forms.Button'和&

编程入门 行业动态 更新时间:2024-10-28 16:21:16
本文介绍了无法将类型'System.Windows.Forms.ProgressBar'隐式转换为'System.Windows.Forms.Button'和& System.Windows.Forms.FolderBrowserDialog”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用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.Bu

本文发布于:2023-11-09 17:02:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572930.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   类型   隐式   System   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!