Nota
O acesso a esta página requer autorização. Pode tentar iniciar sessão ou alterar os diretórios.
O acesso a esta página requer autorização. Pode tentar alterar os diretórios.
Acessar itens específicos em uma caixa de combinação de Windows Forms, caixa de listagem ou caixa de listagem marcado é uma tarefa essencial.Ele permite que você determine o que está em uma lista, em qualquer posição determinada por programação.
Para acessar um item específico
Consultar o Items coleção usando o índice do item específico:
Private Function GetItemText(i As Integer) As String ' Return the text of the item using the index: Return ComboBox1.Items(i).ToString End Functionprivate string GetItemText(int i) { // Return the text of the item using the index: return (comboBox1.Items[i].ToString()); }private String GetItemText(int i) { // Return the text of the item using the index: return comboBox1.get_Items().get_Item( i).ToString() ; }private: String^ GetItemText(int i) { // Return the text of the item using the index: return (comboBox1->Items->Item[i]->ToString()); }