Change the text brush

Stimulsoft Reports.NET discussion
Post Reply
lsilva.gvdasa
Posts: 25
Joined: Tue Apr 11, 2017 4:47 pm

Change the text brush

Post by lsilva.gvdasa »

Hello guys.

Can you tell me how to change the text brush via code?

For the data band I got something like:

Code: Select all

((DataBand2 as StiDataBand).Brush as StiSolidBrush).Color = Color.Gainsboro;
And for the text object i'm trying something like:

Code: Select all

((Text7 as StiText).Brush as StiSolidBrush).Color = Color.Gainsboro;
But it's not working.

Thks.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Change the text brush

Post by Andrew »

Hello,

Thank you for the question.

You can use following code in the BeforePrintEvent of the DataBand:

Code: Select all

 DataBand5.Brush = new StiSolidBrush(Color.Red);
Please take into consideration that you cannot use AFterPrintEvent for this.

Thank you.
lsilva.gvdasa
Posts: 25
Joined: Tue Apr 11, 2017 4:47 pm

Re: Change the text brush

Post by lsilva.gvdasa »

Works fine.

Thks.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Change the text brush

Post by Andrew »

I am glad to help you!
Post Reply