DataGridViewRowPostPaintEventArgs.State プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewRowPostPaintEventArgs.State プロパティの意味・解説 

DataGridViewRowPostPaintEventArgs.State プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

現在の DataGridViewRow の状態を取得します

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

Public ReadOnly Property
 State As DataGridViewElementStates
Dim instance As DataGridViewRowPostPaintEventArgs
Dim value As DataGridViewElementStates

value = instance.State
public DataGridViewElementStates State { get;
 }
public:
property DataGridViewElementStates State {
    DataGridViewElementStates get ();
}
/** @property */
public DataGridViewElementStates get_State ()
public function get State
 () : DataGridViewElementStates

プロパティ
行の状態を指定する DataGridViewElementStates 値のビットごとの組み合わせ

解説解説

このプロパティ使用して、行が固定された状態か、読み取り専用か、または選択されているか、という各状態を確認できます

使用例使用例

State プロパティ使用して現在の行が選択されているかどうか確認する方法次のコード例示します変数 e の型が DataGridViewRowPostPaintEventArgs です。次のコード例は、「方法 : Windows フォームの DataGridView コントロールの行の外観カスタマイズする」で示されている例の一部です。

' Determine the foreground color.
If (e.State And DataGridViewElementStates.Selected)
 = _
    DataGridViewElementStates.Selected Then

    forebrush = New SolidBrush(e.InheritedRowStyle.SelectionForeColor)
Else
    forebrush = New SolidBrush(e.InheritedRowStyle.ForeColor)
End If
// Determine the foreground color.
if ((e.State & DataGridViewElementStates.Selected) ==
    DataGridViewElementStates.Selected)
{
    forebrush = new SolidBrush(e.InheritedRowStyle.SelectionForeColor);
}
else
{
    forebrush = new SolidBrush(e.InheritedRowStyle.ForeColor);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewRowPostPaintEventArgs クラス
DataGridViewRowPostPaintEventArgs メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewElementStates 列挙


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataGridViewRowPostPaintEventArgs.State プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataGridViewRowPostPaintEventArgs.State プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataGridViewRowPostPaintEventArgs.State プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

DataGridViewRowPostPaintEventArgs.State プロパティのお隣キーワード
検索ランキング

   

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



DataGridViewRowPostPaintEventArgs.State プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS