ex.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DblClick Event and List Box Control Example
                        Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
' In this example, a selected list item is displayed in a text box when
' either:
' • A command button is clicked
' • A list box control item is double-clicked
 
' To try this example:
' 1. Choose New Project from the File menu
' 2. Choose New Form from the File menu to create a form with a list box,
'    a command button, and a text box.
' 3. Press Alt+F4 to return to the programming environment
' 4. Copy the code example below to the form module
' 5. Press F5 to run the example
 
 SUB Command1_Click ()
     Text1.Text = List1.Text  ' Display selection in text box
 END SUB
 
 SUB Form_Load ()
     List1.ADDITEM "John"     ' Add list box entries
     List1.ADDITEM "Paul"
     List1.ADDITEM "George"
     List1.ADDITEM "Ringo"
 END SUB
 
 SUB List1_DblClick ()
     Command1.Value = -1      ' Trigger Click event for Command1
 END SUB