locked
Progress bar with double value

    Question

  • Hi,

    Is there any kind of Progress Bar that accepts "double" or "float" values ?

    Thanks,
    Friday, August 12, 2011 9:39 AM

Answers

  • Why do you specifically need such a ProgressBar, it's not like you cannot convert a float value to an integer value:

    Assuming that your float value is between 0.0..1.0 and that the progress bar uses the default range (0..100) then all you need to do is:

    progressBar.Value = (int)(floatValue * 100.0f);

    • Marked as answer by Bouki Friday, August 12, 2011 10:58 AM
    Friday, August 12, 2011 10:23 AM

All replies

  • Why do you specifically need such a ProgressBar, it's not like you cannot convert a float value to an integer value:

    Assuming that your float value is between 0.0..1.0 and that the progress bar uses the default range (0..100) then all you need to do is:

    progressBar.Value = (int)(floatValue * 100.0f);

    • Marked as answer by Bouki Friday, August 12, 2011 10:58 AM
    Friday, August 12, 2011 10:23 AM
  • Please feel free to let us know if you need further support later.

    Thanks,


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, September 12, 2011 2:37 AM