Visual Basic (Declaration) | |
---|---|
Public Sub ResetFocusRenderer() |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As FpSpread instance.ResetFocusRenderer() |
C# | |
---|---|
public void ResetFocusRenderer() |
This example uses the ResetFocusRenderer method.
C# | Copy Code |
---|---|
public class MyIndicator : FarPoint.Win.Spread.IFocusIndicatorRenderer { public void Paint(System.Drawing.Graphics g, int x, int y, int width, int height, bool left, bool top, bool right, bool bottom) { SolidBrush r = new SolidBrush(System.Drawing.Color.Red); SolidBrush b = new SolidBrush(System.Drawing.Color.Blue); SolidBrush gr = new SolidBrush(System.Drawing.Color.DarkGreen); g.FillRectangle(r, x, y, 1, height); g.FillRectangle(gr, x, y, width, 1); g.FillRectangle(r, x + width - 1, y, 1, height); g.FillRectangle(b, x, y + height - 1, width, 1); } } private void Form1_Load(object sender, EventArgs e) { FarPoint.Win.Spread.SolidFocusIndicatorRenderer sfir = new FarPoint.Win.Spread.SolidFocusIndicatorRenderer(Color.Blue, 2); fpSpread1.FocusRenderer = sfir; fpSpread1.FocusRenderer = new MyIndicator(); fpSpread1.ResetFocusRenderer(); } |
Visual Basic | Copy Code |
---|---|
Public Class MyIndicator Implements FarPoint.Win.Spread.IFocusIndicatorRenderer Public Sub Paint(ByVal g As System.Drawing.Graphics, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal left As Boolean, ByVal top As Boolean, ByVal right As Boolean, ByVal bottom As Boolean) Implements FarPoint.Win.Spread.IFocusIndicatorRenderer.Paint Dim r As New SolidBrush(Color.Red) Dim b As New SolidBrush(Color.Blue) Dim gr As New SolidBrush(Color.DarkGreen) g.FillRectangle(r, x, y, 1, height) g.FillRectangle(gr, x, y, width, 1) g.FillRectangle(r, x + width - 1, y, 1, height) g.FillRectangle(b, x, y + height - 1, width, 1) End Sub End Class Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim sfir As New FarPoint.Win.Spread.SolidFocusIndicatorRenderer(Color.Blue, 2) FpSpread1.FocusRenderer = sfir FpSpread1.FocusRenderer = New MyIndicator() FpSpread1.ResetFocusRenderer() End Sub |
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8