Changing font properties of an ITextBoxShape object

Hie,

i'de like to know how can i change properties like Bold, Font type, etc... of the text i insert into an ITextBoxShape object ?

Thanks.

1 Reply

MK Manoj Kumar G M Syncfusion Team August 30, 2012 11:54 AM UTC

Hi Elad,

Thank you for choosing Syncfusion products.

You can also use rich-text formatting for the textbox elements to enhance their appearance.

The following code examples explain how to apply rich-text formatting to the textbox elements.

            IFont redFont = workbook.CreateFont();

 

            redFont.Bold = true;

 

            redFont.Italic = false;

 

            redFont.Size = 6;

 

            redFont.FontName = "Georgia";

 

            redFont.Color = ExcelKnownColors.Red;

 

            ITextBoxShape textbox = sheet.TextBoxes.AddTextBox(3, 7, 25, 100);

            textbox.RichText.Text="Essential XlsIO";

 

            textbox.RichText.SetFont(0,14, redFont);

 

Please let us know if you require any further clarifications.

Regards,

Manojkumar.


Loader.
Up arrow icon