Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleInitialize a ComboBox using values from a TextBox with the Split command
KeywordsListItem, list, ComboBox, TextBox, add, Split
CategoriesControls
 
Use Split to break the text into lines and add each non-blank line to the ComboBox.
 
Private Sub Command1_Click()
Dim entries As Variant
Dim i As Integer

    Combo1.Clear
    entries = Split(Text1.Text, vbCrLf)
    For i = LBound(entries) To UBound(entries)
        If Len(entries(i)) > 0 Then
            Combo1.AddItem entries(i)
        End If
    Next i

    Text1.Text = ""
    Combo1.ListIndex = 0
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated