Results 1 to 2 of 2

Thread: [2008] Sorting Textboxes and putting result in Alphabetical order

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    7

    Question [2008] Sorting Textboxes and putting result in Alphabetical order

    I have three textboxes and need the txb.Result show all three text boxes in alphabetical order. I have them going to the result box, but not in alphabetical order. Help!

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: [2008] Sorting Textboxes and putting result in Alphabetical order

    try this:

    vb Code:
    1. Dim textList As New List(Of String)
    2. For x As Integer = 1 To 3
    3.      If Me.Controls("Textbox" & x.ToString).Text <> String.Empty Then
    4.         textList.Add(Me.Controls("Textbox" & x.ToString).Text)
    5.      End If
    6. Next
    7. textList.Sort()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width