int / double type conversion within function

Posted on 2005-05-09
Last Modified: 2010-04-16
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!

Question by:i-Thomas
    LVL 48

    Accepted Solution

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

    Author Comment

    Hello AlexFM!

    Quick and great!

    Thanks a lot!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now