- Home
- Forum
- Silverlight
- DocIO TextBox: set background to transparent
DocIO TextBox: set background to transparent
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.
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
thanks for the reply. However, the same problem persists - the fillcolour of the textbox seems to be white, not transparent.
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
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
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);
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
Hi,
I am using de version 19.4.053 of Syncfusion.DocIO and the problem seem persists. The textbox fill color is not transparent but white.
What news ?
Thanks
Hi Danielle,
Currently, DocIO library doesn’t support transparency in textbox fill color. We
have already logged this as a feature request in our database. We don’t have
any immediate plans to implement this feature. We will let you know when this
feature is implemented.
As a workaround, kindly use Shape
instead of Textbox in your Word document. Because transparency is supported in Shape
in DocIO.
Please refer to the below UG documentation to know more about working with shapes.
Working
with shapes
Please refer to the below code snippet to set transparency for a shape in a Word
document.
WordDocument document = new WordDocument();
document.EnsureMinimal();
//Append shape to the document.
Shape shape = document.LastParagraph.AppendShape(AutoShapeType.Rectangle, 100, 100);
//Set fill color for the shape.
shape.FillFormat.Color = System.Drawing.Color.Red;
//Set transparency for the shape.
shape.FillFormat.Transparency = 50;
//Save and close the document.
document.Save(@"../../Output.docx", Syncfusion.DocIO.FormatType.Docx);
document.Close();
Regards,
Akash.
- 9 Replies
- 5 Participants
-
KD Kevin Dockx
- Jan 13, 2011 12:35 PM UTC
- Nov 14, 2023 02:04 PM UTC