SpreadsheetGear.IRange range = cells["F10"];
double x, y;
if (worksheet.WindowInfo.FreezePanes) { // ウィンドウ枠の固定実行時
RangeLocationFlags rangeLocationFlags;
var splitRows = worksheet.WindowInfo.SplitRows;
var splitColumns = worksheet.WindowInfo.SplitColumns;
if (splitRows > 0 && splitColumns > 0) { // 4分割
// セルが4分割のどこにいるか
if (splitRows - range.Row > 0 && splitColumns - range.Column > 0) {
rangeLocationFlags = RangeLocationFlags.Pane1;
} else if (splitRows - range.Row > 0) {
rangeLocationFlags = RangeLocationFlags.Pane2;
} else if (splitColumns - range.Column > 0) {
rangeLocationFlags = RangeLocationFlags.Pane3;
} else {
rangeLocationFlags = RangeLocationFlags.Pane4;
}
} else { // 2分割
if (splitRows - range.Row > 0 || splitColumns - range.Column > 0) {
rangeLocationFlags = RangeLocationFlags.Pane1;
} else {
rangeLocationFlags = RangeLocationFlags.Pane2;
}
}
// セル位置取得
this.RangeToLocation(range.Row, range.Column, out x, out y, rangeLocationFlags);
} else {
// セル位置取得
this.RangeToLocation(range.Row, range.Column, out x, out y);
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme