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

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

DataGridView.CurrentCellAddress プロパティ

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

現在アクティブセルの行インデックスおよび列インデックス取得します

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

Dim instance As DataGridView
Dim value As Point

value = instance.CurrentCellAddress
public Point CurrentCellAddress { get; }
public:
property Point CurrentCellAddress {
    Point get ();
}
/** @property */
public Point get_CurrentCellAddress ()
public function get CurrentCellAddress
 () : Point

プロパティ
現在アクティブセルの行インデックスおよび列インデックスを表す Point

解説解説

セル直接アクセスせずに現在のセルの行および列を確認するには、このプロパティ使用します。これは、共有行が非共有ならないようにする場合に便利です。行の共有詳細については、「Windows フォーム DataGridView コントロール拡張するための推奨される手順」を参照してください

使用例使用例

行を描画するシナリオCurrentCellAddress プロパティ使用する方法コード例次に示します。この例では、このプロパティ現在のセルの行インデックス格納するために使用されます。ユーザー現在のセル別の行に変更すると、行は強制的に描画されます。

ここに示すコードは、「方法 : Windows フォームの DataGridView コントロールの行の外観カスタマイズする」で取り上げられているコード一部です。

' Forces the row to repaint itself when the user changes the 
' current cell. This is necessary to refresh the focus rectangle.
Sub dataGridView1_CurrentCellChanged(ByVal
 sender As Object, _
    ByVal e As EventArgs) Handles
 dataGridView1.CurrentCellChanged

    If oldRowIndex <> -1 Then
        Me.dataGridView1.InvalidateRow(oldRowIndex)
    End If
    oldRowIndex = Me.dataGridView1.CurrentCellAddress.Y

End Sub 'dataGridView1_CurrentCellChanged
// Forces the row to repaint itself when the user changes the 
// current cell. This is necessary to refresh the focus rectangle.
void dataGridView1_CurrentCellChanged(object sender, EventArgs
 e)
{
    if (oldRowIndex != -1)
    {
        this.dataGridView1.InvalidateRow(oldRowIndex);
    }
    oldRowIndex = this.dataGridView1.CurrentCellAddress.Y;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「DataGridView.CurrentCellAddress プロパティ」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS