Interface for performing basic painting operations
Namespace: Dapfor.Net.UiAssembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)
Syntax
C# |
---|
public interface IRender |
Visual Basic |
---|
Public Interface IRender |
Visual C++ |
---|
public interface class IRender |
F# |
---|
type IRender = interface end |
Remarks
Copy | |
---|---|
public void CellCustomDraw(Grid grid) { //Demonstrates, how to custom draw in cell. //The delegate is called while the cell's painting grid.PaintCell += delegate(object sender, PaintCellEventArgs e) { //Draw a button in the cell's bounds. Color startColor = Color.LightGray; Color endColor = Color.LightSlateGray; //Take into account, that the row can be selected. if (e.Cell.Row != null && e.Cell.Row.Selected) { startColor = PaintHelper.AlphaBlend(startColor, grid.Selection.Color); endColor = PaintHelper.AlphaBlend(endColor, grid.Selection.Color); } //Draw the background Appearance appearance = new Appearance(SystemColors.GrayText, startColor, true, endColor, GradientDirection.Vertical); e.Render.DrawCaption(appearance, ElementState.Normal, e.Cell.VirtualBounds, BorderSide.All, e.Graphics); //Prevent from background erasing e.Parts &= e.Parts ^ (PaintPart.Background | PaintPart.Borders); //Set a new text color e.Appearance.ForeColor = Color.Yellow; //Do default painting without the text drawing e.PaintAll(); }; } |