Exemplo n.º 1
0
        public override Size GetPreferredSize(Size proposedSize)
        {
            Size preferredSize;

            base.GetPreferredSize(proposedSize);

            using (var g = CreateGraphics())
            {
                proposedSize  = new Size(int.MaxValue, int.MaxValue);
                preferredSize = TextRenderer.MeasureText(g, ProgressPercentText, WellsMetroFonts.ProgressBar(metroLabelSize, metroLabelWeight), proposedSize, WellsMetroPaint.GetTextFormatFlags(TextAlign));
            }

            return(preferredSize);
        }
Exemplo n.º 2
0
        private void DrawProgressText(Graphics graphics)
        {
            if (HideProgressText)
            {
                return;
            }

            Color foreColor;

            if (!Enabled)
            {
                foreColor = WellsMetroPaint.ForeColor.ProgressBar.Disabled(Theme);
            }
            else
            {
                foreColor = WellsMetroPaint.ForeColor.ProgressBar.Normal(Theme);
            }

            TextRenderer.DrawText(graphics, ProgressPercentText, WellsMetroFonts.ProgressBar(metroLabelSize, metroLabelWeight), ClientRectangle, foreColor, WellsMetroPaint.GetTextFormatFlags(TextAlign));
        }