在ASP.NET中用OWC.Spreadsheet其中单元格边框和背景色设置的问题!

smartmao 2005-09-22 09:00:40
小弟诚心求助,分不够可以加:

1.ASP.NET的代码页里,我我定义一个OWC,设置某单元格为黑色可以这样写:
owc.Sheets(1).cells(1,1).Borders.Color = "#000000"
但这样会把单元格的4个边都设成黑色,如果只想把左边和上边设成黑色该怎么写?

2.想设置某单元格的背景色该怎么写?没找到哪个属性是,但觉得应该有的.

...全文
451 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
ilovejolly 2006-05-22
  • 打赏
  • 举报
回复
mark
Aspirant_shirly 2006-05-22
  • 打赏
  • 举报
回复
//创建ChartSpace对象来放置图表
OWC11.ChartSpace objCSpace = new OWC11.ChartSpaceClass();
//在ChartSpace对象中添加图表,Add方法返回chart对象
OWC11.ChChart objChart = objCSpace.Charts.Add (0);

objChart.Interior.Color = "DarkOrange"; //整个图表的背景色
objChart.PlotArea.BackWall.Interior.Color = "black";
objChart.PlotArea.Interior.Color = "LightGreen"; //画图区的背景色
xmllover111 2006-03-16
  • 打赏
  • 举报
回复
自己在Excel里运行宏,按你自己的要求录制完后看宏代码.
在SpreadSheet里就知道怎么样处理了.
xmllover111 2006-03-16
  • 打赏
  • 举报
回复
Me.AxSpreadsheet1.Selection.Borders.ColorIndex = 45
Dim xlt As Excel.XlBorderWeight = Excel.XlBorderWeight.xlMedium
Dim xll As Excel.XlLineStyle = Excel.XlLineStyle.xlContinuous
With Me.AxSpreadsheet1.Selection
With .Borders(Microsoft.Office.Interop.Owc11.XlBordersIndex.xlEdgeBottom)
.Weight = xlt
.LineStyle = xll
End With
With .Borders(Microsoft.Office.Interop.Owc11.XlBordersIndex.xlEdgeLeft)
.Weight = xlt
.LineStyle = xll
End With
With .Borders(Microsoft.Office.Interop.Owc11.XlBordersIndex.xlEdgeRight)
.Weight = xlt
.LineStyle = xll
End With
With .Borders(Microsoft.Office.Interop.Owc11.XlBordersIndex.xlEdgeTop)
.Weight = xlt
.LineStyle = xll
End With
End With
Andy__Huang 2005-12-29
  • 打赏
  • 举报
回复
這行代碼可以實現
xlApp.Range(xlApp.Cells(intRow + 5, 1), xlApp.Cells(intRow + 5, 10)).Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlContinuous

我也遇到過這樣的問題,請你慢慢研究
smartmao 2005-09-23
  • 打赏
  • 举报
回复
lovelxj 2005-09-23
  • 打赏
  • 举报
回复
没有用过OWC
如果OWC和表格一样的话
那你可以先在表格中调试出显示效果 再应用到OWC中
考虑下是否可以应用样式
smartmao 2005-09-23
  • 打赏
  • 举报
回复
smartmao 2005-09-23
  • 打赏
  • 举报
回复
2天了都没试出来,才来这里求助的!
amendajing 2005-09-23
  • 打赏
  • 举报
回复
应该都没对应属性的,仔细找找
smartmao 2005-09-23
  • 打赏
  • 举报
回复
不能事先设定,事先是不确定要处理哪个格的。要动态生成的,在程序里写。
netren2000 2005-09-22
  • 打赏
  • 举报
回复
我也想知道!:)

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧