To associate a script with a list box:
Elements pane, drag the list box icon from the to the Content pane of the Controls section.
With the list box control selection handles visible, choose Dashboard, then Properties.
Enter Time in the Name field and then clear the Allow Multiple Selections check box.
When Allow Multiple Values is not selected, only one selection is allowed.
Click the Values tab, add the values Today, Tomorrow, and Yesterday, and then click OK.
In the Content frame, select the Time list box control and choose Dashboard, then Scripts or press F8.
Use the Object browser to navigate to Application , then Methods and then double-click Alert.
Application.Alert()
This method displays an alert box. The content of the alert is controlled with arguments added between the parentheses.
Click in the parentheses after Alert and use the Object browser to navigate to Controls Objects, then Time, then SelectedList, then Methods and then double-click Item.
Application.Alert(Time.SelectedList.Item())
The SelectedList object contains the list of user selections. Time.SelectedList.Item() needs a number as the argument to point to the specific item in the list of user selections.
Toggle to Run mode, press Ctrl+D and select an item in the Time list box.
You have just learned to associate a script with a list box.
Edit the Alert to say What a wonderful day! after the selected item. Type a plus sign (+) in the parentheses after Item(1), and enclose the new phrase (a string) in quotes.
Application.Alert(Time.SelectedList.Item(1)+" What a wonderful day!")