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.
Unfortunately, activation email could not send to your email. Please try again.

DocIO TextBox: set background to transparent

Thread ID:

Created:

Updated:

Platform:

Replies:

97849 Jan 13,2011 07:35 AM Feb 22,2012 11:17 PM Silverlight 7
loading
Tags: DocIO
Kevin Dockx
Asked On January 13, 2011 07:35 AM

I'm trying to add a TextBox to a Word document, and set the background to transparent / no fill colour. However, this does not seem to work: background is always white.

The code to set the FillColor works when setting it to any other colour (eg: yellow), but not when setting it to Transparent, or to any colour with alpha level 0 (= no opacity):

textbox.TextBoxFormat.NoLine = true;
textbox.TextBoxFormat.FillEfects.Color = System.Drawing.Color.Transparent;


I've also tried with this code, but the problem persists:

textbox.TextBoxFormat.NoLine = true;
textbox.TextBoxFormat.FillEfects.Type = BackgroundType.NoBackground;
textbox.TextBoxFormat.FillColor = System.Drawing.Color.Transparent;
textbox.TextBoxFormat.FillEfects.Color = System.Drawing.Color.Transparent;


Any ideas on how to solve this? The textboxes are laying on top of an image and are the frontpage of a report we're generating, so it's essential they've got a transparent background.


Poornima R [Syncfusion]
Replied On January 17, 2011 02:05 AM

Hi Kevin,

Thank you for your interest in Syncfusion Products.

For your requirement of displaying transparency effect for the text box above the picture, could you please try the below code snippet and let us know if this helps you.

Code Snippet:

textBox.TextBoxFormat.FillColor = Color.Transparent;
textBox.TextBoxFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;


Please let us know if you have any queries.

Regards,
Poornima



Kevin Dockx
Replied On January 17, 2011 04:07 AM

Hello,

thanks for the reply. However, the same problem persists - the fillcolour of the textbox seems to be white, not transparent.


Kevin Dockx
Replied On January 17, 2011 10:50 AM

Update: we solved the problem by adding the textboxes to the template, formatting them so the background is transparent, and accessing them as such. Formatting them from code doesn't seem to work...


Poornima R [Syncfusion]
Replied On January 18, 2011 07:28 AM

Hi Kevin,

Thank you for your update

We were able to reproduce the mentioned issue with "Transparancy effect of textbox". We suspect this could be a defect. We have forwarded this issue to our development team for further analysis.

Could you please report this issue through Direct Trac Developer Support System
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let me know if you have any questions.

Regards,
Poornima



Poornima R [Syncfusion]
Replied On January 18, 2011 08:21 AM

Hi Kevin,

Thank you for your update

We were able to reproduce the mentioned issue with "Setting Transparancy effect for textbox". We suspect this could be a defect. We have forwarded this issue to our development team for further analysis.

Could you please report this issue through Direct Trac Developer Support System
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let me know if you have any questions.

Regards,
Poornima



Sudhanva
Replied On February 22, 2012 04:16 AM

Hello,

I am using syncfusion ver 9.4.I want to allign the text to center
inside the TextBox.can you please provide me a sample code to align text to center

Code:
IWTextBox Address = footerPar.AppendTextBox(210, 60);
Address.TextBoxFormat.LineColor = System.Drawing.Color.White;


Address.TextBoxBody.AddParagraph().AppendText(cmpaddrtxt.Text);


Poornima R [Syncfusion]
Replied On February 22, 2012 11:17 PM

Hi Sudhan,

Thank you for your update.

Regarding your requirement of “Preserving center alignment for the text within the textbox”, please try setting the horizontal alignment for the paragraph within the text box as in the below code snippet. Please try using the below code snippet and let us know if this meets your requirement.

Code snippet:

IWTextBox Address = footerPar.AppendTextBox(210, 60);
Address.TextBoxFormat.LineColor = System.Drawing.Color.White;
IWParagraph paragraph = Address.TextBoxBody.AddParagraph();
paragraph.AppendText(cmpaddrtxt.Text);
paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;


Please let us know if you have any questions.

Regards,
Poornima



CONFIRMATION

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.

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.

;