You have two problems. First, Opacity requires a double, not a decimal value. The compiler is telling you that while there is a conversion between decimal and double, it is an explicit conversion that you need to specify in order for it to work. The second is that TrackBar.Value is an integer value and dividing an int by an int results in an int, no matter what type of variable you assign it to. In this case there is an implicit cast from int to decimal or double -- because there is no loss of precision when you do the cast -- so the compiler doesn't complain, but the value you get is always 0, presumably, since trackBar.Value is always less than 5000. The solution is to change your code to use double (the native type for Opacity) and do floating point arithmetic by explicitly making the constant a double -- which will have the effect of promoting the arithmetic -- or casting trackBar.Value to double, which will do the same thing -- or both. Oh, and you don't need the intermediate variable unless it used elsewhere. My guess is the compiler would optimize it away, anyway.
trackBar.Opacity = (double)trackBar.Value / 5000.0;