GridTableStylesCollection.Item[String] GridTableStylesCollection.Item[String] GridTableStylesCollection.Item[String] GridTableStylesCollection.Item[String] Property

定義

多載

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得索引所指定的 DataGridTableStyleGets the DataGridTableStyle specified by index.

Item[String] Item[String] Item[String] Item[String]

取得具有指定名稱的 DataGridTableStyleGets the DataGridTableStyle with the specified name.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得索引所指定的 DataGridTableStyleGets the DataGridTableStyle specified by index.

public:
 property System::Windows::Forms::DataGridTableStyle ^ default[int] { System::Windows::Forms::DataGridTableStyle ^ get(int index); };
public System.Windows.Forms.DataGridTableStyle this[int index] { get; }
member this.Item(int) : System.Windows.Forms.DataGridTableStyle
Default Public ReadOnly Property Item(index As Integer) As DataGridTableStyle

參數

index
Int32 Int32 Int32 Int32

要取得之 DataGridTableStyle 的索引。The index of the DataGridTableStyle to get.

屬性值

例外狀況

在指定索引處中不存在任何項目。No item exists at the specified index.

範例

下列程式碼範例會傳回DataGridTableStyleGridTableStylesCollection藉由傳遞的索引Item[String]屬性。The following code example returns a DataGridTableStyle from the GridTableStylesCollection by passing an index to the Item[String] property.

void GetGridTableByIndex()
{
   DataGridTableStyle^ myGridStyle = myDataGrid->TableStyles[ 0 ];
   Console::WriteLine( myGridStyle->MappingName );
}
private void GetGridTableByIndex()
{
   DataGridTableStyle myGridStyle = 
   myDataGrid.TableStyles[0] ;
   Console.WriteLine(myGridStyle.MappingName);
}
Private Sub GetGridTableByIndex()
   Dim myGridStyle As DataGridTableStyle = _
   myDataGrid.TableStyles(0)
   Console.WriteLine(myGridStyle.MappingName)
End Sub

備註

使用AddAddRange方法將項目加入至集合。Use the Add or AddRange method to add items to the collection.

Item[String] Item[String] Item[String] Item[String]

取得具有指定名稱的 DataGridTableStyleGets the DataGridTableStyle with the specified name.

public:
 property System::Windows::Forms::DataGridTableStyle ^ default[System::String ^] { System::Windows::Forms::DataGridTableStyle ^ get(System::String ^ tableName); };
public System.Windows.Forms.DataGridTableStyle this[string tableName] { get; }
member this.Item(string) : System.Windows.Forms.DataGridTableStyle
Default Public ReadOnly Property Item(tableName As String) As DataGridTableStyle

參數

tableName
String String String String

要擷取之 MappingNameDataGridTableStyleThe MappingName of the DataGridTableStyle to retrieve.

屬性值

範例

下列程式碼範例會傳回DataGridTableStyleGridTableStylesCollection藉由傳遞MappingNameItem[String]屬性。The following code example returns a DataGridTableStyle from the GridTableStylesCollection by passing the MappingName to the Item[String] property.

void GetGridTableByName()
{
   DataGridTableStyle^ myGridStyle = myDataGrid->TableStyles[ "customers" ];
   Console::WriteLine( myGridStyle->MappingName );
}
private void GetGridTableByName()
{
   DataGridTableStyle myGridStyle = 
   myDataGrid.TableStyles["customers"] ;
   Console.WriteLine(myGridStyle.MappingName);
}
private Sub GetGridTableByName()
   Dim myGridStyle As DataGridTableStyle = _
   myDataGrid.TableStyles("customers")
   Console.WriteLine(myGridStyle.MappingName)
End Sub

備註

當擷取DataGridTableStyleMappingName,則Item[String]屬性會使用不區分大小寫的比較。When retrieving a DataGridTableStyle by MappingName, the Item[String] property uses a case-insensitive comparison.

使用AddAddRange方法將項目加入至集合。Use the Add or AddRange method to add items to the collection.

適用於