Sort lines in Rich Text Box

How do I sort the lines in a Rich Text box in VB6?
trondsorensenAsked:
Who is Participating?
 
deightonConnect With a Mentor Commented:
list box with .sorted = true

Private Sub Command1_Click()
'***'list1 has property .sorted = true

Dim x,c
Call RichTextBox1.SaveFile("c:\temp\temp.txt", 1)
Open "c:\temp\temp.txt" For Input As #1
List1.Clear
While Not EOF(1)
Line Input #1, x
List1.AddItem x
Wend
Close #1
Open "c:\temp\temp.txt" For Output As #1
For c = 0 To List1.ListCount - 1
Print #1, List1.List(c)
Next
Close #1
Call RichTextBox1.LoadFile("c:\temp\temp.txt")

End Sub

0
All Courses

From novice to tech pro — start learning today.