Elipse Knowledgebase



Basic VBScript for Elipse E3: Lesson 6 - ComboBox and ListBox

ComboBox
 

Figure 11

The ComboBox object displays/hides a list of items configured by the user. To fill the list we use OnStartRunning event. 

Example:

Sub ComboBox1_OnStartRunning()
    'Fill ComboBox
    Clear()
    AddItem "January"
    AddItem "February"
    AddItem "March"
End Sub

Exercises:

1. Create a ComboBox on screen and fill it with all the days of the week.
2. Insert a DataBase object in the project and configure it.
3. Create 3 internal tags named: red, green and blue.
4. Insert a Formula object that keeps a color's amount of red, green and blue. Use the internal tags to load and save the values of the formula. Register at least 4 colors.
5. Fill in the ComboBox with all the registered colors. (Use GetFormulaValueDataObj method from the Viewer)
6. Create a new button on screen to input a new value in the formula. Write the name of the new color in an InputBox. The input value must appear in the ComboBox.
7. Create a button to remove the selected color from the formula's ComboBox. Only the erased color must be removed from the ComboBox.


ListBox
 

Figure 12

A ListBox object is similar to a ComboBox, and displays a list of items configured by the user. To fill this list we use OnStartRunning Event.

Example:

Sub ListBox1_OnStartRunning()
    'Fill ListBox
    Clear()
    AddItem "Monday"
    AddItem "Tuesday"
    AddItem "Wednesday"
End Sub

Exercises:

1. Create a ListBox on screen e fill it with all the days of the week.
2. Display on a message box the name of the selected day.


Artigos Relacionados

Anexos

Comentários de Usuários

Nenhum comentário de usuário. Adicionar um comentário

Comentários do artigo "Basic VBScript for Elipse E3: Lesson 6 - ComboBox and ListBox"

Para adicionar um comentário neste artigo, preencha os campos abaixo. Os campos marcados com asterisco são obrigatórios.

   Nome:
   E-mail:
* Comentário:
* Digite o código abaixo:

 

Detalhes do Artigo

Última Atualização
28th of October, 2009

Autor
Paula Pereira Enéas

Você gostaria de...

Imprimir esta página  Imprimir esta página

Enviar por e-mail esta página  Enviar por e-mail esta página

Adicionar um comentário  Adicionar um comentário

 Avise-me

Avise-me  Adicionar aos favoritos

Remover Marcação Remover Marcação

Editar este Artigo

Edição Rápida

Exportar para PDF


Opinião dos Usuários

Nenhum usuário votou ainda.

Como você classifica este artigo?




Obrigado pelo seu voto.

Continuar