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

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

DataGridViewBand.DefaultCellStyle プロパティ

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

バンド既定セル スタイル取得または設定します

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

Public Overridable Property
 DefaultCellStyle As DataGridViewCellStyle
Dim instance As DataGridViewBand
Dim value As DataGridViewCellStyle

value = instance.DefaultCellStyle

instance.DefaultCellStyle = value
public virtual DataGridViewCellStyle DefaultCellStyle { get;
 set; }
public:
virtual property DataGridViewCellStyle^ DefaultCellStyle {
    DataGridViewCellStyle^ get ();
    void set (DataGridViewCellStyle^ value);
}
/** @property */
public DataGridViewCellStyle get_DefaultCellStyle ()

/** @property */
public void set_DefaultCellStyle (DataGridViewCellStyle
 value)
public function get DefaultCellStyle
 () : DataGridViewCellStyle

public function set DefaultCellStyle
 (value : DataGridViewCellStyle)

プロパティ
DataGridViewBand に関連付けられている DataGridViewCellStyle。

解説解説
使用例使用例

DataGridView 内の最初の列の既定セル スタイル設定するコード例次に示します

' Freeze the first row.
Private Sub Button4_Click(ByVal
 sender As Object, _
    ByVal e As System.EventArgs) Handles
 Button4.Click

    FreezeBand(dataGridView.Rows(0))
End Sub

Private Sub FreezeColumn(ByVal
 sender As Object, _
    ByVal e As System.EventArgs) Handles
 Button5.Click

    FreezeBand(dataGridView.Columns(1))
End Sub

Private Shared Sub FreezeBand(ByVal
 band As DataGridViewBand)

    band.Frozen = True
    Dim style As DataGridViewCellStyle = New
 DataGridViewCellStyle()
    style.BackColor = Color.WhiteSmoke
    band.DefaultCellStyle = style

End Sub
// Freeze the first row.
private void Button4_Click(object sender, System.EventArgs
 e)
{

    FreezeBand(dataGridView.Rows[0]);
}

private void Button5_Click(object sender, System.EventArgs
 e)
{

    FreezeBand(dataGridView.Columns[1]);
}

private static void FreezeBand(DataGridViewBand
 band)
{
    band.Frozen = true;
    DataGridViewCellStyle style = new DataGridViewCellStyle();
    style.BackColor = Color.WhiteSmoke;
    band.DefaultCellStyle = style;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewBand クラス
DataGridViewBand メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewRow
DataGridViewColumn
DataGridViewCellStyle
その他の技術情報
Windows フォーム DataGridView コントロールでのセルスタイル



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

辞書ショートカット

すべての辞書の索引

「DataGridViewBand.DefaultCellStyle プロパティ」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS