DataGridViewColumnCollection.Contains 方法

定義

判斷指定的資料行是否在集合中。Determines whether the given column is in the collection.

多載

Contains(String)

判斷集合是否包含指定名稱所參考的資料行。Determines whether the collection contains the column referred to by the given name.

Contains(DataGridViewColumn)

判斷集合是否包含指定的資料行。Determines whether the collection contains the given column.

Contains(String)

判斷集合是否包含指定名稱所參考的資料行。Determines whether the collection contains the column referred to by the given name.

public:
 virtual bool Contains(System::String ^ columnName);
public virtual bool Contains (string columnName);
abstract member Contains : string -> bool
override this.Contains : string -> bool
Public Overridable Function Contains (columnName As String) As Boolean

參數

columnName
String

要搜尋之資料行的名稱。The name of the column to look for.

傳回

如果資料行是包含在集合中則為 true,否則為 falsetrue if the column is contained in the collection; otherwise, false.

例外狀況

columnNamenullcolumnName is null.

備註

資料行的名稱是由DataGridViewColumn.Name屬性所表示。The name of a column is indicated by the DataGridViewColumn.Name property.

另請參閱

Contains(DataGridViewColumn)

判斷集合是否包含指定的資料行。Determines whether the collection contains the given column.

public:
 virtual bool Contains(System::Windows::Forms::DataGridViewColumn ^ dataGridViewColumn);
public virtual bool Contains (System.Windows.Forms.DataGridViewColumn dataGridViewColumn);
abstract member Contains : System.Windows.Forms.DataGridViewColumn -> bool
override this.Contains : System.Windows.Forms.DataGridViewColumn -> bool

參數

dataGridViewColumn
DataGridViewColumn

要尋找的 DataGridViewColumnThe DataGridViewColumn to look for.

傳回

如果指定的資料行是在集合中則為 true,否則為 falsetrue if the given column is in the collection; otherwise, false.

另請參閱

適用於