DataGridViewImageCell クラスとは? わかりやすく解説

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

DataGridViewImageCell クラス

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

DataGridView コントロール内にグラフィック表示します

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

Public Class DataGridViewImageCell
    Inherits DataGridViewCell
Dim instance As DataGridViewImageCell
public class DataGridViewImageCell : DataGridViewCell
public ref class DataGridViewImageCell : public
 DataGridViewCell
public class DataGridViewImageCell extends
 DataGridViewCell
public class DataGridViewImageCell extends
 DataGridViewCell
解説解説

DataGridViewImageCell クラスは DataGridViewCell の特殊な型で、ValueIsIcon プロパティの値に応じて Image または Icon表示するために使用されます。通常DataGridViewImageCellReadOnly プロパティtrue設定されるため、ユーザーセル内容編集できません。

DataGridViewImageColumn は、この種類セル保持するための特殊な列型です。既存DataGridViewImageCell を列に含まれる他のセルモデルにするには、そのセルを列の CellTemplate プロパティ設定します既定では、CellTemplate新しDataGridViewImageCell初期化されます

列のセル関連プロパティは、テンプレート セル類似した名前を持つプロパティラッパーです。テンプレート セルプロパティ値を変更すると、そのテンプレートベースとするセルのうち、変更後追加されたものにのみ変更反映されます。一方、列のセル関連プロパティ変更すると、テンプレート セル、および列内の他のすべてのセル更新され必要に応じて列の表示更新されます。

継承時の注意 DataGridViewImageCell からクラス派生させて新しプロパティ追加する場合は、Clone メソッドオーバーライドして、クローン操作時に新しプロパティコピーする必要がありますまた、基本クラスClone メソッド呼び出して基本クラスプロパティ新しセルコピーされるようにする必要があります

使用例使用例

DataGridViewColumn のテンプレートとして DataGridViewCell使用する方法コード例次に示します。列のセルスタイルの変更は、その列のすべてのセル影響します。このコード例は、DataGridViewColumn クラストピック取り上げているコード例一部分です。

Private Sub CustomizeCellsInThirdColumn()

    Dim thirdColumn As Integer
 = 2
    Dim column As DataGridViewColumn = _
        dataGridView.Columns(thirdColumn)
    Dim cell As DataGridViewCell = _
        New DataGridViewTextBoxCell()

    cell.Style.BackColor = Color.Wheat
    column.CellTemplate = cell
End Sub
private void CustomizeCellsInThirdColumn()
{
    int thirdColumn = 2;
    DataGridViewColumn column =
        dataGridView.Columns[thirdColumn];
    DataGridViewCell cell = new DataGridViewTextBoxCell();

    cell.Style.BackColor = Color.Wheat;
    column.CellTemplate = cell;
}
継承階層継承階層
System.Object
   System.Windows.Forms.DataGridViewElement
     System.Windows.Forms.DataGridViewCell
      System.Windows.Forms.DataGridViewImageCell
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewImageCell メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewCell クラス
DataGridViewImageColumn
DataGridViewImageColumn.CellTemplate
Image
Icon
ValueIsIcon



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

辞書ショートカット

すべての辞書の索引

「DataGridViewImageCell クラス」の関連用語

DataGridViewImageCell クラスのお隣キーワード
検索ランキング

   

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



DataGridViewImageCell クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS