This is a migrated thread and some comments may be shown as answers.

Setting up RadProgressBar text shadow

1 Answer 38 Views
ProgressBar
This is a migrated thread and some comments may be shown as answers.
Kuba
Top achievements
Rank 1
Kuba asked on 04 Dec 2013, 12:18 PM
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);

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Dec 2013, 09:20 AM
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 >>
Tags
ProgressBar
Asked by
Kuba
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or