Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Aug 05, 2014 8:11 pm

I have a problem here is the code
Code: Select all
chart.TextBoxes.AddTextBox(300, 1000, 200, 500).ShapeType = ExcelShapeType.TextBox;
chart.TextBoxes[0].Text = "Hello";

when I run this code it creates the textboxes just fine but I want to remove the lines that surround the text and I look in the documentation and I am stuck on how to remove the borders.

Thank You

andrewhoang09
 
Posts: 8
Joined: Tue Jul 15, 2014 8:56 pm

Wed Aug 06, 2014 4:01 am

Hello,

Thanks for your inquiry.
Sorry that the current version of Spire.Xls doesn't support the feature. But we has added it into our schedule. The next version may support it. We will inform you immediately when the feature is supported.

Please feel free to contact us if you have any problems.

Best wishes,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Fri Aug 08, 2014 6:09 am

Hello,

Thanks for your waiting.
We found a solution to remove the border of textbox. Please refer to the following code:

Code: Select all
XlsTextBoxShape textbox = chart.TextBoxes.AddTextBox(1, 1, 40, 80) as XlsTextBoxShape;
textbox.Text = "hello";
textbox.Line.Style = ShapeLineStyleType.LineThickBetweenThin;
textbox.Line.ForeKnownColor = ExcelColors.SkyBlue;
textbox.Line.Weight = 0; //set 0 then invisible


Best wishes,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Wed Aug 13, 2014 3:28 am

Hello,

Have you tested the code? Did it resolve your issue?
Thanks for your feedback.

Best wishes,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Jan 10, 2023 9:05 am

I am using spire.pdf. my objective is to draw a rectangle, color its background, and draw text. these seem pretty working but when I draw rect, I see borders that I would like to remove, help is appreciated.

monaThahmeen
 
Posts: 1
Joined: Tue Jan 10, 2023 8:47 am

Tue Jan 10, 2023 10:28 am

Hi Mona,

Thank you for your inquiry.
Our Spire.PDF has two approaches to achieve your desired effect when adding rectangle.
I. Please invoke the overloaded method without the Pen, it will not draw a border.
Code: Select all
page.Canvas.DrawRectangle(brush,new Rectangle(new Point(x, y), new Size(width, height)));

II. You can set the Pen color to be the same as the brush color.
Code: Select all
PdfPen pen = new PdfPen(Color.White, 0.1f);
PdfBrush brush = new PdfSolidBrush(Color.White);
page.Canvas.DrawRectangle(pen, brush,new Rectangle(new Point(x, y), new Size(width, height)));

If you have any issues, welcome to write back.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 66
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.XLS