我想使用轨迹栏来改变窗体的不透明度.
这是我的代码:
decimal trans = trackBar1.Value / 5000; this.Opacity = trans;
当我构建应用程序时,它会出现以下错误:
无法隐式转换decimal为double.
decimal
double
我尝试使用trans,double但然后控件不起作用.这段代码在过去的VB.NET项目中运行良好.
trans
c# floating-point double decimal type-conversion
c# ×1
decimal ×1
double ×1
floating-point ×1
type-conversion ×1