private void toolStripButton15_Click(object sender, EventArgs e) { using (FarPoint.Win.Spread.Design.BorderEditor borderedit = new FarPoint.Win.Spread.Design.BorderEditor(fpSpread1)) { borderedit.Shown += new EventHandler(borderedit_Shown); DesignHelper.LocalizationCHS(borderedit); if (sheet.SelectionCount == 0) { borderedit.StartColumn = sheet.ActiveColumnIndex; borderedit.ColumnCount = 1; borderedit.StartRow = sheet.ActiveRowIndex; borderedit.RowCount = 1; } else { CellRange range = sheet.GetSelection(0); //选中区域 if (range != null) { borderedit.StartColumn = range.Column; borderedit.ColumnCount = range.ColumnCount; borderedit.StartRow = range.Row; borderedit.RowCount = range.RowCount; } } borderedit.ShowDialog(); } btn_save.Enabled = true; }
private void tool_borderSet_Click(object sender, EventArgs e) { using (FarPoint.Win.Spread.Design.BorderEditor borderedit = new FarPoint.Win.Spread.Design.BorderEditor(fpSpread1)) { borderedit.Shown += new EventHandler(borderedit_Shown); DesignHelper.LocalizationCHS(borderedit); if (borderedit.ShowDialog() == DialogResult.OK) { Cell cell = DesignHelper.GetSelectedCell(sheet); if (cell != null) { List <CellStruct> list = DesignHelper.GetListCellStruct(cell, dt); foreach (CellStruct cellStruct in list) { if (cell.Border == null) { cellStruct.DrawInfo.BoundaryLine.SetNoBoundary(); } else { cellStruct.DrawInfo.BoundaryLine.UpperBoundaryLine = cell.Border.Inset.Top == 1; cellStruct.DrawInfo.BoundaryLine.LowerBoundaryLine = cell.Border.Inset.Bottom == 1; cellStruct.DrawInfo.BoundaryLine.LeftBoundaryLine = cell.Border.Inset.Left == 1; cellStruct.DrawInfo.BoundaryLine.RightBooundaryLine = cell.Border.Inset.Right == 1; } } } } } }