示例#1
0
        public void ChangeControlValue_Accuracy(double accuracy)
        {
            accuracy = AccuracyAbs.ReturnDiffrence(accuracy);
            this.PercentValue_ProgressBar.Style = ReturnColorProgress.ReturnMetroColor(accuracy);

            this.GramValue_Label.Text  = "";
            this.OverHunder_Label.Text = ((int)accuracy).ToString() + "%";
            if (accuracy > 100)  // cap na value progress bar
            {
                accuracy = 100;
            }
            else if (accuracy < 0)
            {
                accuracy = 100;
            }
            this.PercentValue_ProgressBar.Value = (int)accuracy;
        }
示例#2
0
        public void ChangeControlValue(double value, double gramsdemand, string suffix)
        {
            double percents = value / (gramsdemand / 100);

            this.PercentValue_ProgressBar.Style = ReturnColorProgress.ReturnMetroColor(percents);


            if (percents > 100)
            {
                this.PercentValue_ProgressBar.Value = 100;
            }
            else
            {
                this.PercentValue_ProgressBar.Value = (int)percents;
            }
            this.GramValue_Label.Text  = Math.Round(value, 1).ToString() + " " + suffix;
            this.OverHunder_Label.Text = ((int)percents).ToString() + "%";
        }