找回密码
 立即注册

QQ登录

只需一步,快速开始

jleidong

注册会员

6

主题

19

帖子

69

积分

注册会员

积分
69

活字格认证

最新发帖

[已处理] 画边框

jleidong
注册会员   /  发表于:2015-3-31 15:37  /   查看:5196  /  回复:5
选多个单元格画边框,除了最外边是单线,里边的线都是加粗了,好像是两条线叠加在一起,很难看。

WindowsApplication1.rar

81.61 KB, 下载次数: 107

5 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2015-4-1 12:19:00
沙发
回复 1楼jleidong的帖子

Spread的边框是有Gridline和Border。
请问你的具体需求是什么,你想画成什么样的线?我帮你看看如何实现。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
jleidong
注册会员   /  发表于:2015-4-2 12:54:00
板凳
选中多个单元格后,画所有单线的边框线。所有边框线粗细要一致,现在的情况是最外边和里面的看着明显粗细不一致。
QQ图片20150402125311.png
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-4-2 16:27:00
地板
回复 3楼jleidong的帖子

你好。
如果你是在设计器上设计边线的话,不要直接使用AllBorders。而是打开Border编辑器,选择Style(比如,Thin),然后点击Outline和Inside按钮设置边线。
效果如下:

SpreadBorder.png

对应代码如下:
  1. FarPoint.Win.ComplexBorder complexBorder1 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  2.             FarPoint.Win.ComplexBorder complexBorder2 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  3.             FarPoint.Win.ComplexBorder complexBorder3 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  4.             FarPoint.Win.ComplexBorder complexBorder4 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  5.             FarPoint.Win.ComplexBorder complexBorder5 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  6.             FarPoint.Win.ComplexBorder complexBorder6 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  7.             FarPoint.Win.ComplexBorder complexBorder7 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  8.             FarPoint.Win.ComplexBorder complexBorder8 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  9.             FarPoint.Win.ComplexBorder complexBorder9 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  10.             FarPoint.Win.ComplexBorder complexBorder10 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  11.             FarPoint.Win.ComplexBorder complexBorder11 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  12.             FarPoint.Win.ComplexBorder complexBorder12 = new FarPoint.Win.ComplexBorder(new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.None), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine), new FarPoint.Win.ComplexBorderSide(FarPoint.Win.ComplexBorderSideStyle.ThinLine));
  13.             this.fpSpread1_Sheet1.Cells.Get(4, 2).Border = complexBorder1;
  14.             this.fpSpread1_Sheet1.Cells.Get(4, 3).Border = complexBorder2;
  15.             this.fpSpread1_Sheet1.Cells.Get(4, 4).Border = complexBorder3;
  16.             this.fpSpread1_Sheet1.Cells.Get(5, 2).Border = complexBorder4;
  17.             this.fpSpread1_Sheet1.Cells.Get(5, 3).Border = complexBorder5;
  18.             this.fpSpread1_Sheet1.Cells.Get(5, 4).Border = complexBorder6;
  19.             this.fpSpread1_Sheet1.Cells.Get(6, 2).Border = complexBorder7;
  20.             this.fpSpread1_Sheet1.Cells.Get(6, 3).Border = complexBorder8;
  21.             this.fpSpread1_Sheet1.Cells.Get(6, 4).Border = complexBorder9;
  22.             this.fpSpread1_Sheet1.Cells.Get(7, 2).Border = complexBorder10;
  23.             this.fpSpread1_Sheet1.Cells.Get(7, 3).Border = complexBorder11;
  24.             this.fpSpread1_Sheet1.Cells.Get(7, 4).Border = complexBorder12;
复制代码
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
jleidong
注册会员   /  发表于:2015-4-7 14:20:00
5#
这个我知道,代码太多了,希望改进AllBorders方法。
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-4-7 18:34:00
6#
回复 5楼jleidong的帖子

谢谢你的反馈。
目前来说,这是设计。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部