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.
AutoRedraw and ListCount Property Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
' This example loads a list into a combo box control and displays the list
' count on the form. When you choose the command button, the list is cleared.
' 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:
' • Combo box
' • Command button
' 3. Set object properties:
' • For form, AutoRedraw = True
' • For combo box, Style = 2 (Dropdown List)
' 4. Press Alt+F4 to return to the programming environment
' 5. Copy the code example below to the form module
' 6. Press F5 to run the example
SUB Command1_Click ()
IF Combo1.ListCount <> 0 THEN
Combo1.REMOVEITEM 0
END IF
CLS ' Clear the screen
PRINT "Number of Items in List:"; Combo1.ListCount
END SUB
SUB Form_Load ()
Combo1.ADDITEM "Breakfast" ' Add each item to list
Combo1.ADDITEM "Lunch"
Combo1.ADDITEM "Dinner"
PRINT "Number of Items in List:"; Combo1.ListCount
END SUB