本帖最后由 Lynn.Dou 于 2021-7-26 11:46 编辑
经测试代码是 Strstyle 中border相关的属性导致的此问题,与backColor、hAlign 等属性不同,
设置boder时,需要先创建一个LineBorder对象,
建议您通过以下方式设置border:
- var style = new GC.Spread.Sheets.Style();
- style.backColor = "red";
- style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
- style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
- style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
- style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
- activeSheet.setStyle(-1,1,style);
复制代码
|