Objeto ListBox (Script do Outlook Forms)

Exibe uma lista de valores e permite selecionar um ou mais valores.

Comentários

Se o ListBox estiver ligado a uma fonte de dados, o ListBox armazenará o valor selecionado nessa fonte de dados.

O ListBox pode ser exibido como uma lista ou como um grupo de controles OptionButton ou CheckBox.

A propriedade padrão de um ListBox é a propriedade Value.

O evento padrão de um ListBox é o evento Click.

Não é possível soltar texto em um ListBox suspenso.

Estilos de caixa de listagem

É possível escolher um dos dois estilos de apresentação de um ListBox. Isso é expresso pela propriedade ListStyle . Cada estilo fornece diferentes maneiras para a seleção de itens na lista pelos usuários.

Se o estilo for 0, cada item será exibido em uma linha separada; o usuário selecionará um item realçando uma ou mais linhas.

Se o estilo for 1, um OptionButton ou CheckBox aparecerá no início de cada linha. Com esse estilo, o usuário selecionará um item clicando no botão de opção ou na caixa de seleção. As caixas de seleção aparecem somente quando a propriedade MultiSelect é True.

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 ListBox, the AddItem method adds an item to the list. For a multicolumn ListBox, this method adds a row to the list.
Clear Removes all entries in the list in a ListBox.
RemoveItem Remove uma linha da lista em uma ListBox.

Propriedades

Nome Descrição
BackColor Returns or sets a Long that specifies the background color of the 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 ListBox. Leitura/gravação.
Coluna Returns or sets a Variant that represents a single value, a column of values, or a two-dimensional array to load into a ListBox. Leitura/gravação.
ColumnCount Returns or sets a Long that represents the number of columns to display in a list 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 ListBox. 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.
ForeColor Returns or sets a Long that specifies the foreground color of an object. 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.
IntegralHeight Returns or sets a Boolean that specifies whether a ListBox displays full lines of text in a list or partial lines. Leitura/gravação.
List Returns or sets a Variant that represents the specified entry in a ListBox. Leitura/gravação.
ListCount Returns a Long that represents the number of list entries in a control. Somente leitura.
ListIndex Retorna ou define um valor Variant que representa o item selecionado em um ListBox. Leitura/gravação.
ListStyle Retorna ou define um Inteiro que especifica a aparência visual da lista em uma ListBox. 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 ListBox searches its list as the user types. 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.
MultiSelect Returns or sets an Integer that indicates whether the object permits multiple selections. Leitura/gravação.
Selected Returns or sets a Boolean that indicates the selection state of items in a ListBox. Leitura/gravação.
SpecialEffect Returns or sets an Integer that specifies the visual appearance of an object. Leitura/gravação.
Text Returns or sets a String that specifies text in a ListBox, 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 ListBox to display to the user. Leitura/gravação.
TopIndex Returns or sets a Long that represents the index of the list item displayed in the topmost position in the list. 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.