Convert Decimal to Double

I want to use a `Track-Bar` to change a `Form`'s opacity. This is my code: ```c# decimal trans = trackBar1.Value / 5000; this.Opacity = trans; ``` When I build the application, it gives the following error: > Cannot implicitly convert type `decimal` to `double` I have tried using `trans` and `double` but then the `Control` doesn't work. This code worked fine in a past VB.NET project.
Also, Decimal can't represent as wide a value as a Double. Decimal can only go up to +/-7.9228162514264337593543950335E+28; whereas a Double can go up to +/-1.79769313486232E+308

以上就是Convert Decimal to Double的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS 教程

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准