请教高手,怎么操作Excel选中区域的外边框变色? 请问,如果选中Excel的一个区域,用C#怎么才能让区域整体的外边框编程红色(不是单元格的边框颜色),在线等!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Microsoft.Office.Interop.Excel.Range c = myExcel.get_Range(cell1, cell2); c.Borders.ColorIndex = 3; c.Borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous; c.Borders.Weight = 2; 我试了下,这个Range的borders设置的是单元格。我想实现一个整体选中区域的四个边框变色,里面单元格的颜色不变,这么说您清楚吗? GDI+不好用啊,谁会实现这个功能? 一个简单的办法,录制宏,进行你所需要的操作,然后去看VBA的代码Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeLeft); c.Borders.ColorIndex=3; c.Borders.LineStyle= Microsoft.Office.Int;Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeTop); c.Borders.ColorIndex=3; c.Borders.LineStyle= Microsoft.Office.Int;Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeBottom); c.Borders.ColorIndex=3; c.Borders.LineStyle= Microsoft.Office.Int;Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeRight); c.Borders.ColorIndex=3; c.Borders.LineStyle= Microsoft.Office.Int刚录制了下宏,C#应该是上面的代码,没在VS环境里写,可能有错误 c#实现公交换乘查询,如何设计数据库?设计思路给点建议 一个简单的求余运算 C# 一个监听 同时判断多个客户端发来的信息,有时候没有监听到! 求助 导出问题!!!! [求助]问个问题,就是怎么把自己写的自定义控件添加到工具里面?具体点! 如何在调用数据集的tableadapter时写入语句 很奇怪的線程問題,請高手們解釋一下 请问是什么原因??? c# 怎么设置文件或文件夹的属性 和访问权限 datagridview刚失去焦点时无法取值 如何实现 点击datagridview中查询到的数据,让数据对应到相应的textbox 中 数学问题,求排列组合?
Microsoft.Office.Interop.Excel.Range c = myExcel.get_Range(cell1, cell2);
c.Borders.ColorIndex = 3;
c.Borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous;
c.Borders.Weight = 2;
Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeLeft);
c.Borders.ColorIndex=3;
c.Borders.LineStyle= Microsoft.Office.Int;Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeTop);
c.Borders.ColorIndex=3;
c.Borders.LineStyle= Microsoft.Office.Int;Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeBottom);
c.Borders.ColorIndex=3;
c.Borders.LineStyle= Microsoft.Office.Int;Microsoft.Office.Interop.Excel.Range c= myExcel.get_Range(cell1, cell2).Borders(xlEdgeRight);
c.Borders.ColorIndex=3;
c.Borders.LineStyle= Microsoft.Office.Int
刚录制了下宏,C#应该是上面的代码,没在VS环境里写,可能有错误