Hittade ett exempel i MSDN:
Private Sub Form_Load ()
Dim I ' Declare variable.
AutoRedraw = True ' Set AutoRedraw.
For I = 0 To Printer.FontCount - 1 ' Put font names in list.
Combo1.AddItem Printer.Fonts(I)
Next I
Combo1.ListIndex = 0 ' Set text to first item.
' Print ListCount information on form.
Print "Number of printer fonts: "; Combo1.ListCount
End Sub
Private Sub Command1_Click ()
Static UpperCase
Dim I ' Declare variable.
For I = 0 To Combo1.ListCount - 1 ' Loop through list.
If UpperCase Then
Combo1.List(I) = UCase(Combo1.List(I))
Else
Combo1.List(I) = LCase(Combo1.List(I))
End If
Next I
UpperCase = Not UpperCase ' Change case.
End Sub
