GridTableStylesCollection.Contains GridTableStylesCollection.Contains GridTableStylesCollection.Contains GridTableStylesCollection.Contains Method

定義

取得值,指出 GridTableStylesCollection 是否含有指定的 DataGridTableStyleGets a value indicating whether the GridTableStylesCollection contains the specified DataGridTableStyle.

多載

Contains(String) Contains(String) Contains(String) Contains(String)

取得值,指出 GridTableStylesCollection 是否含有依名稱指定的 DataGridTableStyleGets a value indicating whether the GridTableStylesCollection contains the DataGridTableStyle specified by name.

Contains(DataGridTableStyle) Contains(DataGridTableStyle) Contains(DataGridTableStyle) Contains(DataGridTableStyle)

取得值,指出 GridTableStylesCollection 是否含有指定的 DataGridTableStyleGets a value indicating whether the GridTableStylesCollection contains the specified DataGridTableStyle.

Contains(String) Contains(String) Contains(String) Contains(String)

取得值,指出 GridTableStylesCollection 是否含有依名稱指定的 DataGridTableStyleGets a value indicating whether the GridTableStylesCollection contains the DataGridTableStyle specified by name.

public:
 bool Contains(System::String ^ name);
public bool Contains (string name);
member this.Contains : string -> bool
Public Function Contains (name As String) As Boolean

參數

name
String String String String

要尋找之 MappingNameDataGridTableStyleThe MappingName of the DataGridTableStyle to look for.

傳回

如果指定的資料表樣式在集合中,則為 true,否則為 falsetrue if the specified table style exists in the collection; otherwise, false.

範例

下列程式碼範例會使用Contains方法來判斷DataGridTableStyle集合中是否存在具有MappingName指定的。The following code example uses the Contains method to determine if a DataGridTableStyle with the specified MappingName exists in the collection.

void TestContains()
{
   bool isContained;
   isContained = myDataGrid->TableStyles->Contains( "Customers" );
   Console::WriteLine( isContained );
}
private void TestContains()
{
   bool isContained;
   isContained = myDataGrid.TableStyles.Contains("Customers");
   Console.WriteLine(isContained);
}
private Sub TestContains()
   Dim isContained As Boolean
   isContained = myDataGrid.TableStyles.Contains("Customers")
   Console.WriteLine(isContained)
End Sub

Contains(DataGridTableStyle) Contains(DataGridTableStyle) Contains(DataGridTableStyle) Contains(DataGridTableStyle)

取得值,指出 GridTableStylesCollection 是否含有指定的 DataGridTableStyleGets a value indicating whether the GridTableStylesCollection contains the specified DataGridTableStyle.

public:
 bool Contains(System::Windows::Forms::DataGridTableStyle ^ table);
public bool Contains (System.Windows.Forms.DataGridTableStyle table);
member this.Contains : System.Windows.Forms.DataGridTableStyle -> bool
Public Function Contains (table As DataGridTableStyle) As Boolean

參數

傳回

如果指定的資料表樣式在集合中,則為 true,否則為 falsetrue if the specified table style exists in the collection; otherwise, false.

適用於