Setting up RadProgressBar text shadow

2 posts, 0 answers
  1. Kuba
    Kuba avatar
    13 posts
    Member since:
    Aug 2013

    Posted 04 Dec 2013 Link to this post

    Hi!

    I need to add shadow to RadProgressBar text. I've tried to add new TextPrimitive element with shadow to Children collection (it works for RadWaitingBar), but the control shows only the existing ProgressBarTextElement. Unfortunately, I can,t manage to change Shadow member for ProgressBarTextElement. 

    Code changing shadow that does not work:
    ((ProgressBarTextElement)this.TablesProgressBar.ProgressBarElement.Children[3]).Shadow = new ShadowSettings(new Point(1, 1), Color.Black);

    Code that works for RadWaitingBar:
    this.DownloadedRowsWaitingBar.ShowText = false;
    TextPrimitive textElement_wb = new TextPrimitive();
    textElement_wb.Alignment = ContentAlignment.MiddleCenter;
    textElement_wb.ZIndex = 100;
    textElement_wb.Shadow = new Telerik.WinControls.Paint.ShadowSettings(new Point(1, 1), Color.Black);
    this.DownloadedRowsWaitingBar.WaitingBarElement.Children.Add(textElement_wb);
  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 09 Dec 2013 Link to this post

    Hello Kuba,

    Thank you for contacting Telerik Support.

    In order to achieve your goal with shadowing the text inside the RadProgressBar, it is appropriate to use the same approach as for the RadWaitingBar:
    this.radProgressBar1.ProgressBarElement.TextElement.Text = string.Empty;
    TextPrimitive tp = new TextPrimitive();
    tp.Text = "sample";
    tp.Alignment = ContentAlignment.MiddleCenter;
    tp.ZIndex = 100;
    tp.Shadow = new Telerik.WinControls.Paint.ShadowSettings(new Point(1, 1), Color.Black);
    this.radProgressBar1.ProgressBarElement.TextElement.Children.Add(tp);

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top