|
-
May 8th, 2004, 06:00 AM
#18
Addicted Member
Hi,
Dim boxArr As New ArrayList()
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = 13 Then
boxArr.Add(Val((TextBox1.Text))) 'Add text into the array
ListSort() 'Sort the array
TextBox1.Clear() 'Clear text ready for next one
End If
End Sub
Private Sub ListSort()
boxArr.Sort()
Dim i As Int16
ListBox1.Items.Clear() 'Clear list
For i = 0 To boxArr.Count - 1
ListBox1.Items.Add(boxArr(i))
Next
End Sub
Have a nice day
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|