Exemplo n.º 1
0
        // Token: 0x060001EC RID: 492 RVA: 0x00006CFC File Offset: 0x00004EFC
        private void DrawProgressText(Graphics graphics)
        {
            if (this.HideProgressText)
            {
                return;
            }
            Color transparent = Color.Transparent;
            Color foreColor   = (!base.Enabled) ? MetroPaint.ForeColor.ProgressBar.Disabled(base.Theme) : MetroPaint.ForeColor.ProgressBar.Normal(base.Theme);

            TextRenderer.DrawText(graphics, this.ProgressPercentText, MetroFonts.ProgressBar(this.metroLabelSize, this.metroLabelWeight), base.ClientRectangle, foreColor, transparent, MetroPaint.GetTextFormatFlags(this.TextAlign));
        }
        private void DrawProgressText(Graphics graphics)
        {
            Color color;

            if (this.HideProgressText)
            {
                return;
            }
            color = (base.Enabled ? MetroPaint.ForeColor.ProgressBar.Normal(this.Theme) : MetroPaint.ForeColor.ProgressBar.Disabled(this.Theme));
            TextRenderer.DrawText(graphics, this.ProgressPercentText, MetroFonts.ProgressBar(this.metroLabelSize, this.metroLabelWeight), base.ClientRectangle, color, MetroPaint.GetTextFormatFlags(this.TextAlign));
        }
        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, MetroFonts.ProgressBar(metroLabelSize, metroLabelWeight), proposedSize, MetroPaint.GetTextFormatFlags(TextAlign));
            }

            return(preferredSize);
        }
        private void DrawProgressText(Graphics graphics)
        {
            if (HideProgressText)
            {
                return;
            }

            Color foreColor;

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

            TextRenderer.DrawText(graphics, ProgressPercentText, MetroFonts.ProgressBar(metroLabelSize, metroLabelWeight), ClientRectangle, foreColor, MetroPaint.GetTextFormatFlags(TextAlign));
        }
Exemplo n.º 5
0
        // Token: 0x060001ED RID: 493 RVA: 0x00006D6C File Offset: 0x00004F6C
        public override Size GetPreferredSize(Size proposedSize)
        {
            base.GetPreferredSize(proposedSize);
            Size result;

            using (Graphics graphics = base.CreateGraphics())
            {
                proposedSize = new Size(int.MaxValue, int.MaxValue);
                result       = TextRenderer.MeasureText(graphics, this.ProgressPercentText, MetroFonts.ProgressBar(this.metroLabelSize, this.metroLabelWeight), proposedSize, MetroPaint.GetTextFormatFlags(this.TextAlign));
            }
            return(result);
        }
 public override System.Drawing.Size GetPreferredSize(System.Drawing.Size proposedSize)
 {
     System.Drawing.Size size;
     base.GetPreferredSize(proposedSize);
     using (Graphics graphic = base.CreateGraphics())
     {
         proposedSize = new System.Drawing.Size(2147483647, 2147483647);
         size         = TextRenderer.MeasureText(graphic, this.ProgressPercentText, MetroFonts.ProgressBar(this.metroLabelSize, this.metroLabelWeight), proposedSize, MetroPaint.GetTextFormatFlags(this.TextAlign));
     }
     return(size);
 }