Observação
O acesso a essa página exige autorização. Você pode tentar entrar ou alterar diretórios.
O acesso a essa página exige autorização. Você pode tentar alterar os diretórios.
Combina as funcionalidades de uma Caixa de Listagem e de uma Caixa de Texto.
Comentários
O usuário pode digitar um novo valor, como no caso de um TextBox, ou selecionar um valor existente, como no caso de um ListBox.
Se um ComboBox estiver ligado a uma fonte de dados, o ComboBox inserirá o valor digitado ou selecionado pelo usuário nessa fonte de dados. Se uma caixa de combinação multicoluna estiver vinculada, a propriedade ColunaVinculada determina qual o valor armazenado na origem de dados vinculada.
A lista de um ComboBox consiste em linhas de dados. Cada linha pode ter uma ou mais colunas, que podem aparecer com ou sem títulos. Algumas aplicações não suportam cabeçalhos de coluna, outras fornecem apenas suporte limitado.
A propriedade padrão de um ComboBox é a propriedade Value.
Se desejar que mais de uma linha da lista sempre apareça, convém usar um ListBox, em vez de um ComboBox. Se desejar usar um ComboBox e limitar-se aos valores da lista, defina a propriedade Style do ComboBox de modo que o controle se assemelhe a uma caixa de listagem suspensa.
Eventos
| Nome | Descrição |
|---|---|
| Click | Occurs when the user definitively selects a value for the control that has more than one possible value. |
Métodos
| Nome | Descrição |
|---|---|
| AddItem | For a single-column ComboBox, the AddItem method adds an item to the list. For a multicolumn ComboBox, this method adds a row to the list. |
| Clear | Removes all entries in the list in a ComboBox. |
| Copy | Copies the contents of an object to the Clipboard. |
| Cut | Removes selected information from an object and transfers it to the Clipboard. |
| DropDown | Displays the list portion of a ComboBox. |
| Paste | Transfers the contents of the Clipboard to an object. |
| RemoveItem | Remove uma linha da lista numa Caixa de Combinação. |
Propriedades
| Nome | Descrição |
|---|---|
| AutoSize | Returns or sets a Boolean that specifies whether an object automatically resizes to display its entire contents. Leitura/gravação. |
| AutoTab | Returns or sets a Boolean that specifies whether an automatic tab occurs when a user enters the maximum allowable number of characters into the text box portion of a ComboBox. Leitura/gravação. |
| AutoWordSelect | Returns or sets a Boolean that specifies whether the basic unit used to extend a selection is a word or a single character. Leitura/gravação. |
| BackColor | Returns or sets a Long that specifies the background color of the object. Leitura/gravação. |
| BackStyle | Returns or sets an Integer that specifies the background style for an object. Leitura/gravação. |
| BorderColor | Returns or sets a Long that specifies the border color of an object. Leitura/gravação. |
| BorderStyle | Returns or sets an Integer that specifies the type of border of the control. Leitura/gravação. |
| BoundColumn | Returns or sets a Variant that identifies the source of data in a multicolumn ComboBox. Leitura/gravação. |
| CanPaste | Returns a Boolean that specifies whether the Clipboard contains data that the object supports. Somente leitura. |
| Coluna | Devolve ou define uma Variante que representa um único valor, uma coluna de valores ou uma matriz bidimensional para carregar para uma Caixa de Combinação. Leitura/gravação. |
| ColumnCount | Returns or sets a Long that represents the number of columns to display in a combo box. Leitura/gravação. |
| ColumnHeads | Returns or sets a Boolean that specifies whether a single row of column headings are displayed. Leitura/gravação. |
| ColumnWidths | Returns or sets a String that specifies the width of each column in a multicolumn ComboBox. Leitura/gravação. |
| CurTargetX | Returns a Long that represents the preferred horizontal position of the insertion point in a multiline ComboBox. Somente leitura. |
| CurX | Returns or sets a Long that represents the current horizontal position of the insertion point in a multiline ComboBox. Leitura/gravação. |
| DragBehavior | Returns or sets an Integer that specifies whether the system enables the drag-and-drop feature for the control. Leitura/gravação. |
| DropButtonStyle | Returns or sets a fmDropButtonStyle value that represents the symbol displayed on the drop button in a ComboBox. Leitura/gravação. |
| Enabled | Returns or sets a Boolean that specifies whether a control can receive the focus and respond to user-generated events. Leitura/gravação. |
| EnterFieldBehavior | Returns or sets an Integer that specifies the selection behavior when entering a ComboBox. Leitura/gravação. |
| ForeColor | Returns or sets a Long that specifies the foreground color of an object. Leitura/gravação. |
| HideSelection | Returns or sets a Boolean that specifies whether selected text remains highlighted when a control does not have the focus. Leitura/gravação. |
| IMEMode | Returns or sets an Integer that specifies the default run-time mode of the Input Method Editor (IME) for a control. Leitura/gravação. |
| LineCount | Returns a Long that specifies the number of text lines in a ComboBox. Somente leitura. |
| List | Returns or sets a Variant that represents the specified entry in a ComboBox. Leitura/gravação. |
| ListCount | Returns a Long that represents the number of list entries in a control. Somente leitura. |
| ListIndex | Returns or sets a Variant that represents the currently selected item in a ComboBox. Leitura/gravação. |
| ListRows | Returns or sets a Long that specifies the maximum number of rows to display in the list. Leitura/gravação. |
| ListStyle | Devolve ou define um Número Inteiro que especifica o aspeto visual da lista numa Caixa de Combinação. Leitura/gravação. |
| ListWidth | Returns or sets a Variant that specifies the width of the list in a ComboBox. Leitura/gravação. |
| Locked | Returns or sets a Boolean that specifies whether a control can be edited. Leitura/gravação. |
| MatchEntry | Returns or sets an Integer that indicates how a ComboBox searches its list as the user types. Leitura/gravação. |
| MatchFound | Returns a Boolean value that indicates whether the text that a user has typed into a ComboBox matches any of the entries in the list. Somente leitura. |
| MatchRequired | Devolve ou define um Valor booleano que especifica se um valor introduzido na parte de texto de uma Caixa de Combinação tem de corresponder a uma entrada na parte da lista existente do controlo. Leitura/gravação. |
| MaxLength | Devolve ou define um Valor Longo que especifica o número máximo de carateres que um utilizador pode introduzir numa Caixa de Combinação. Leitura/gravação. |
| MouseIcon | Returns a String that represents the full path name of a custom icon that is to be assigned to the control. Somente leitura. |
| MousePointer | Returns or sets an Integer that specifies the type of pointer displayed when the user positions the mouse over a particular object. Leitura/gravação. |
| SelectionMargin | Returns or sets a Boolean that specifies whether the user can select a line of text by clicking in the region to the left of the text. Leitura/gravação. |
| SelLength | Devolve ou define um Valor Longo que representa o número de carateres selecionados na parte de texto de uma Caixa de Combinação. Leitura/gravação. |
| SelStart | Returns or sets a Long that represents the starting point of selected text, or the insertion point if no text is selected. Leitura/gravação. |
| SelText | Returns or sets a String that represents the selected text of a control. Leitura/gravação. |
| ShowDropButtonWhen | Returns or sets a fmShowDropButtonWhen value that specifies when to show the drop-down button for a ComboBox. Leitura/gravação. |
| SpecialEffect | Returns or sets an Integer that specifies the visual appearance of an object. Leitura/gravação. |
| Estilo | Returns or sets an Integer that specifies how the user can choose or set the control's value. Leitura/gravação. |
| Text | Returns or sets a String that specifies text in a ComboBox, changing the selected row in the control. Leitura/gravação. |
| TextAlign | Returns or sets an Integer that specifies how text is aligned in a control. Leitura/gravação. |
| TextColumn | Returns or sets a Variant that identifies the column in a ComboBox to display to the user. Leitura/gravação. |
| TextLength | Devolve um Valor Longo que representa o comprimento, em número de carateres, do texto na região de edição de uma Caixa de Combinação. Somente leitura. |
| TopIndex | Returns or sets a Long that represents the index of the item displayed in the topmost position in the list portion of the ComboBox. Leitura/gravação. |
| Valor | Returns or sets a Variant that specifies the value in the BoundColumn of the currently selected rows. Leitura/gravação. |
Suporte e comentários
Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.