SoftArtisans“ Border.Part.Outline”的工作方式类似于SoftArtisans“ Border.Part.All”

时间:2019-01-25 14:19:12

标签: excel

SoftArtisans库-Excel 97

SoftArtisans的“ Border.Part.Outline”与SoftArtisans的“ Border.Part.All”一样。

描述:Excel 2016的“ / Home / Outside Borders”选项等效于SoftArtisans“ Border.Part.Outline”  问题很简单。这永远不会按预期工作。

如果我们得到一些单元格范围(例如1到10->行[1:10])而不合并这些范围单元格,则将边框' Border.Part.Outline '选项设置为'< strong> Border.Part.All ”,这是错误的。

这里有一些伪代码:

var myRange = getMyCustRange(myRows[1:10]);
 Style mystyle  = Workbook.GlobalStyle.CreateStyle();

 // If I want to clear border
 mystyle.Border[Border.Part.All] =  Border.LineStyle.None; // test pass, worked!

 // If I want to set border to all cell part of the current range
 mystyle.Border[Border.Part.All] =  Border.LineStyle.Thin; // test pass, worked!

 // If I want to remove Outside Borders
 mystyle.Border[Border.Part.Outline] =  Border.LineStyle.None; // test pass, worked!

 // If I want to set only Outside Borders into current range with more than one rows and thoose rows are not merged -> Area.MergeCells();
 mystyle.Border[Border.Part.Outline] =  Border.LineStyle.Thin; // test FAILED!!!



// Part : TypesafeEnum       
        Border.Part All;
        Border.Part Bottom;
        Border.Part DiagonalBoth;
        Border.Part DiagonalDown;
        Border.Part DiagonalUp;
        Border.Part Left;
        Border.Part Outline;
        Border.Part Right;
        Border.Part Top;

0 个答案:

没有答案