We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I format TextBox objects?

Thread ID:





98228 Feb 15,2011 09:11 PM UTC Feb 16,2011 01:21 PM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Mark Oudesluys
Asked On February 15, 2011 09:11 PM UTC


I am using a number of Excel templates to create reports on the fly. I am having an issue with the TextBoxes on a Chart, where the text gets enlarged quite a bit when I copy the template into the workbook I am creating. I have opened an incident with Syncfusion, but they can't recreate the issue and therefore can't fix it.

So I need to write a bit of code to see if I can fix them myself. But I can't seem to find any way of doing this. Can someone help?

I was doing the following to see if there were any properties of the TextBox object which I could modify:
wsPage.Charts[0].TextBoxes["TBTopLeft"]... (here I was hoping to find something like font or style).

Does anyone know how I might be able to do this?


Sridhar [Syncfusion]
Replied On February 16, 2011 01:21 PM UTC

Hi Mark,

We highly regret for the inconvenience.

We have created the workaround to modify the Text Box’s font style. Please get the workaround and let us know if this helps you

Please follow up the Incident 76970 for more details on this reported issue.


C# Code:

IWorksheet sourceWSheet = sourceWorkbook.Worksheets[0];
IChart chart = sourceWSheet.Charts[0];
ITextBoxes textBoxes = chart.TextBoxes;
int count = chart.TextBoxes.Count;
for (int i = 0; i < count; i++)
ITextBox textBox = textboxes[i];
IFont newFont = destWorkbook.CreateFont();
newFont.Size = 11;
textBox.RichText.SetFont(0, 5, newFont);

Please let us know if you have any clarifications.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon