Free Support Forum - aspose.com

Setting forecolor for a table modifies the thickness of the borderlines

When I set the forecolor of a table , this modifies the borderlines. Some of them are thicker then others. I tried several ideas but none of them works:

Here is the code:

1 idea:

t.GetCell(col,row).TextFrame.FillFormat.Type = FillType.Solid;

t.GetCell(col,row).TextFrame.FillFormat.ForeColor = Color.White;

2 idea:

t.GetCell(col,row).FillFormat.Type = FillType.Solid;

t.GetCell(col,row).FillFormat.ForeColor = Color.White;

I tryed to set the borderlines to ThinThin, but this doesn't work.:

1 idea:

t.GetCell(col,row).BorderBottom.LineFormat.Style = LineStyle.ThinThin;

t.GetCell(col,row).BorderLeft.LineFormat.Style = LineStyle.ThinThin;

t.GetCell(col,row).BorderRight.LineFormat.Style = LineStyle.ThinThin;

t.GetCell(col,row).BorderTop.LineFormat.Style = LineStyle.ThinThin;

2 idea:

t.GetCell(col,row).TextFrame.LineFormat.Style = LineStyle.ThinThin;

Did you try another ForeColor instead of Color.White?

It can be the standard MS problem. MS PowerPoint doesn’t show borders of tables right
if cells filled with White color. It can even draw invisible borders or hide some.

Here is the solution i found was to add this line at the end of the code to enable the lines to be visible

t.GetCell(co,row).TextFrame.LineFormat.ShowLines = true;

Here is the entire code :

t.GetCell(col,row).TextFrame.FillFormat.Type = FillType.Solid;

t.GetCell(col,row).TextFrame.FillFormat.ForeColor = Color.White;

or

t.GetCell(col,row).FillFormat.Type = FillType.Solid;

t.GetCell(col,row).FillFormat.ForeColor = Color.White;

and:

t.GetCell(col,row).BorderBottom.LineFormat.Style = LineStyle.ThinThin;

t.GetCell(col,row).BorderLeft.LineFormat.Style = LineStyle.ThinThin;

t.GetCell(col,row).BorderRight.LineFormat.Style = LineStyle.ThinThin;

t.GetCell(col,row).BorderTop.LineFormat.Style = LineStyle.ThinThin;

t.GetCell(co,row).TextFrame.LineFormat.ShowLines = true;