回复 22楼lzechoca的帖子
可以通过循环累计计算当前合并单元格的位置以及尺寸,以合并(26,5,5,1)为例:
- float top = 0;
- for (int i = 0; i < 26; i++)
- {
- top += this.m_fpSpread.ActiveSheet.Rows[i].Height;
- }
- float left = 0;
- for (int j = 0; j < 5; j++)
- {
- left += this.m_fpSpread.ActiveSheet.Columns[j].Width;
- }
- float width= 0;
- for (int i = 0; i < 1; i++)
- {
- width += this.m_fpSpread.ActiveSheet.Columns[5].Width;
- }
- float height = 0;
- for (int i = 0; i < 5; i++)
- {
- height += this.m_fpSpread.ActiveSheet.Rows[26 + i].Height;
- }
复制代码
Demo,您直接拷贝 Demo 中的代码到原工程即可:
Test8.zip
(113.24 KB, 下载次数: 225)
|