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.


Related Articles

Attachments

Visitor Comments

No visitor comments posted. Post a comment

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

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.

   Name:
   Email:
* Comment:
* Enter the code below:

 

Article Details

Last Updated
3rd of January, 2012

Autor
Paula Pereira Enéas

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit


User Opinions

No users have voted.

How would you rate this answer?




Thank you for rating this answer.

Continue