Re: Comparing and Ranking Textboxes
- From: "Matt F" <mfielderREMOVECAPS@xxxxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 12:11:39 -0700
I'm not 100% sure I understand what it is you're looking for, but the code
below shows adding the values to an array and then using that array to
repopulate the textboxes with the values sorted. Note that .LostFocus event
is handled instead of TextChanged --- other wise some unexpected results
occur.
Private Sub TextBoxValueChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) _
Handles TextBox1.LostFocus, TextBox2.LostFocus, TextBox3.LostFocus,
TextBox4.LostFocus, TextBox5.LostFocus
' load value into an array
Dim arr(4) As String
arr(0) = TextBox1.Text
arr(1) = TextBox2.Text
arr(2) = TextBox3.Text
arr(3) = TextBox4.Text
arr(4) = TextBox5.Text
' sort the array
Array.Sort(arr)
' output sorted values to text boxes
TextBox1.Text = arr(0).ToString
TextBox2.Text = arr(1).ToString
TextBox3.Text = arr(2).ToString
TextBox4.Text = arr(3).ToString
TextBox5.Text = arr(4).ToString
End Sub
.
- Follow-Ups:
- Re: Comparing and Ranking Textboxes
- From: Cor Ligthert[MVP]
- Re: Comparing and Ranking Textboxes
- References:
- Comparing and Ranking Textboxes
- From: lmefford@xxxxxxxxx
- Comparing and Ranking Textboxes
- Prev by Date: TextWriter synchronized method
- Next by Date: Re: Local Mouse Hook problem
- Previous by thread: Comparing and Ranking Textboxes
- Next by thread: Re: Comparing and Ranking Textboxes
- Index(es):
Relevant Pages
|