A
Amranullah
Guest
I have 5 text-boxes in my form. I want to rank them in other text-boxes by pressing a button.
*above 5 text-boxes takes values every time different.
I have tried below mentioned codes but not works.
*Names of new textboxes: textbox25,textbox24,textbox23,textbox22,textbox21
*Names of textboxes which have value for ranking already mentioned in following code.
Dim i As String() = New String() {Val(TextBox20.Text), Val(TextBox19.Text), Val(TextBox18.Text), Val(TextBox17.Text), Val(TextBox16.Text)}
Dim lastScore As Integer
Dim lastScorePosition As Integer
Dim position As Integer = 1
For Each i1 In i
If Val(lastScore) <> Val(i1) Then
TextBox25.Text = (position)
lastScorePosition = position
lastScore = Val(i1)
Else
TextBox25.Text = (lastScorePosition &)
End If
position += 1
Next
Continue reading...
*above 5 text-boxes takes values every time different.
I have tried below mentioned codes but not works.
*Names of new textboxes: textbox25,textbox24,textbox23,textbox22,textbox21
*Names of textboxes which have value for ranking already mentioned in following code.
Dim i As String() = New String() {Val(TextBox20.Text), Val(TextBox19.Text), Val(TextBox18.Text), Val(TextBox17.Text), Val(TextBox16.Text)}
Dim lastScore As Integer
Dim lastScorePosition As Integer
Dim position As Integer = 1
For Each i1 In i
If Val(lastScore) <> Val(i1) Then
TextBox25.Text = (position)
lastScorePosition = position
lastScore = Val(i1)
Else
TextBox25.Text = (lastScorePosition &)
End If
position += 1
Next
Continue reading...