Page 1 of 1

Change the text brush

Posted: Thu May 04, 2017 1:14 pm
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.

Re: Change the text brush

Posted: Fri May 05, 2017 7:29 pm
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.

Re: Change the text brush

Posted: Mon May 08, 2017 12:16 pm
by lsilva.gvdasa
Works fine.

Thks.

Re: Change the text brush

Posted: Mon May 08, 2017 1:18 pm
by Andrew
I am glad to help you!