When setting a form's opacity should I use a decimal or double?
- by Eggs McLaren
I'm new to C#, and I want to use a track-bar to change a form's opacity.
This is my code:
decimal trans = trackBar1.Value / 5000
this.Opacity = trans
When I try to build it, I get this error:
Cannot implicitly convert type 'decimal' to 'double'
I tried making trans a double, but then the control doesn't work. This code worked fine for me in VB.NET.
What do I need to do differently?