TableLayoutPanel.OnCellPaint メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TableLayoutPanel.OnCellPaint メソッドの意味・解説 

TableLayoutPanel.OnCellPaint メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

セル更新する必要があるときに呼び出し受け取ります

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Protected Overridable Sub
 OnCellPaint ( _
    e As TableLayoutCellPaintEventArgs _
)
Dim e As TableLayoutCellPaintEventArgs

Me.OnCellPaint(e)
protected virtual void OnCellPaint (
    TableLayoutCellPaintEventArgs e
)
protected:
virtual void OnCellPaint (
    TableLayoutCellPaintEventArgs^ e
)
protected void OnCellPaint (
    TableLayoutCellPaintEventArgs e
)
protected function OnCellPaint (
    e : TableLayoutCellPaintEventArgs
)

パラメータ

e

イベントに対してデータ提供する TableLayoutCellPaintEventArgs。

使用例使用例

OnCellPaint メソッドオーバーライドして、セルカスタム外観作成する方法次のコード例示します

Public Class DemoTableLayoutPanel
    Inherits TableLayoutPanel

    Protected Overrides Sub
 OnCellPaint( _
    ByVal e As System.Windows.Forms.TableLayoutCellPaintEventArgs)

        MyBase.OnCellPaint(e)

        Dim c As Control = Me.GetControlFromPosition(e.Column,
 e.Row)

        If Not c Is Nothing
 Then
            Dim g As Graphics = e.Graphics

            g.DrawRectangle( _
            Pens.Red, _
            e.CellBounds.Location.X + 1, _
            e.CellBounds.Location.Y + 1, _
            e.CellBounds.Width - 2, _
            e.CellBounds.Height - 2)

            g.FillRectangle( _
            Brushes.Blue, _
            e.CellBounds.Location.X + 1, _
            e.CellBounds.Location.Y + 1, _
            e.CellBounds.Width - 2, _
            e.CellBounds.Height - 2)
        End If

    End Sub

End Class
public class DemoTableLayoutPanel : TableLayoutPanel
{
    protected override void OnCellPaint(TableLayoutCellPaintEventArgs
 e)
    {
        base.OnCellPaint(e);

        Control c = this.GetControlFromPosition(e.Column, e.Row);

        if ( c != null )
        {
            Graphics g = e.Graphics;

            g.DrawRectangle(
                Pens.Red, 
                e.CellBounds.Location.X+1,
                e.CellBounds.Location.Y + 1,
                e.CellBounds.Width - 2, e.CellBounds.Height - 2);

            g.FillRectangle(
                Brushes.Blue, 
                e.CellBounds.Location.X + 1, 
                e.CellBounds.Location.Y + 1, 
                e.CellBounds.Width - 2, 
                e.CellBounds.Height - 2);
        };
    }
    
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

TableLayoutPanel.OnCellPaint メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TableLayoutPanel.OnCellPaint メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS