Spread Windows Forms 8.0 Product Documentation
ResetFocusRenderer Method
Example 


Resets the focus renderer to its original state.
Syntax
'Declaration
 
Public Sub ResetFocusRenderer() 
'Usage
 
Dim instance As FpSpread
 
instance.ResetFocusRenderer()
public void ResetFocusRenderer()
Example
This example uses the ResetFocusRenderer method.
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();
 }
 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
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

Reference

FpSpread Class
FpSpread Members

User-Task Documentation

Customizing the Focus Indicator

 

 


Copyright © GrapeCity, inc. All rights reserved.