PowerTools SPREAD for Windows Forms 10.0J
ResetFocusRenderer メソッド


フォーカスレンダラを最初の状態にリセットします。
構文
'Declaration
 
Public Sub ResetFocusRenderer() 
'使用法
 
Dim instance As FpSpread
 
instance.ResetFocusRenderer()
public void ResetFocusRenderer()
次のサンプルコードは、ResetFocusRendererメソッドを使用します。
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
参照

FpSpread クラス
FpSpread メンバ

開発者ガイド

フォーカスインジケータ

 

 


© 2004-2017, GrapeCity inc. All rights reserved.