/// <summary> /// Change current selection to sub script /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripButtonSubScript_Click(object sender, EventArgs e) { SourceGrid.RangeRegion region = grid1.Selection.GetSelectionRegion(); SourceGrid.PositionCollection poss = region.GetCellsPositions(); for (int i = 0; i < poss.Count; ++i) { getRichTextBoxCell(grid1, poss[i]).SelectionSubScript(); } }
/// <summary> /// Underline current selection. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripButtonUnderline_Click(object sender, EventArgs e) { SourceGrid.RangeRegion region = grid1.Selection.GetSelectionRegion(); SourceGrid.PositionCollection poss = region.GetCellsPositions(); for (int i = 0; i < poss.Count; ++i) { SourceGrid.Cells.Cell cell = grid1.GetCell(poss[i]) as SourceGrid.Cells.Cell; if (cell != null) { getRichTextBoxCell(grid1, poss[i]).SelectionUnderline(); } } }
/// <summary> /// Align current selection to the right /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripButtonRight_Click(object sender, EventArgs e) { SourceGrid.RangeRegion region = grid1.Selection.GetSelectionRegion(); SourceGrid.PositionCollection poss = region.GetCellsPositions(); for (int i = 0; i < poss.Count; ++i) { SourceGrid.Cells.Cell cell = grid1.GetCell(poss[i]) as SourceGrid.Cells.Cell; if (cell != null) { cell.View.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleRight; grid1.PerformLayout(); } } }
/// <summary> /// Change brackround color of current selection /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripButtonBackgroundColor_Click(object sender, EventArgs e) { SourceGrid.RangeRegion region = grid1.Selection.GetSelectionRegion(); SourceGrid.PositionCollection poss = region.GetCellsPositions(); for (int i = 0; i < poss.Count; ++i) { SourceGrid.Cells.Cell cell = grid1.GetCell(poss[i]) as SourceGrid.Cells.Cell; if (cell != null) { cell.View.BackColor = backgroundColor; grid1.PerformLayout(); } } }