• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

int / double type conversion within function

I would like to do the following:

Label.BackColor = Color.FromArgb(2.56 * TrackBar.Value, 2.56 * TrackBar.Value, 2.56 * TracBar.Value);

I get error due to not matching variable types.

What would be the best / most elegant approach to handle things like this, namely multiplying some int values of controls directly within another function?


Thanks a lot in advance for taking your time!

0
i-Thomas
Asked:
i-Thomas
1 Solution
 
AlexFMCommented:
Label.BackColor = Color.FromArgb((int)(2.56 * TrackBar.Value), (int)(2.56 * TrackBar.Value), (int)(2.56 * TracBar.Value));
0
 
i-ThomasAuthor Commented:
Hello AlexFM!

Quick and great!

Thanks a lot!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now