public class SelectionRenderer : FarPoint.Win.Spread.ISelectionRenderer
{
public void PaintSelection(Graphics g, int x, int y, int width, int height)
{
SolidBrush selectionBrush = new SolidBrush(Color.FromArgb(100, SystemColors.ControlDark));
g.FillRectangle(selectionBrush, x, y, width, height);
selectionBrush.Dispose();
}
}
FarPoint.Win.Spread.FpSpread fpSpread1 = new FarPoint.Win.Spread.FpSpread();
FarPoint.Win.Spread.SheetView shv = new FarPoint.Win.Spread.SheetView();
SelectionRenderer sr = new SelectionRenderer();
fpSpread1.Location = new Point(10, 10);
fpSpread1.Height = 200;
fpSpread1.Width = 400;
Controls.Add(fpSpread1);
fpSpread1.Sheets.Add(shv);
fpSpread1.SelectionRenderer = sr;
fpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2);