indy500fan
asked on
Is there a more simple way to set a text field in this case?
Friends,
I have the following block of code, but I am hoping there is a more simple way to set the textbox?
Here is the code:
Private Sub SetValueOfPosition(ByVal FinalBasePayout, ByVal Position)
Select Case Position
Case 1
txt1.Text = FinalBasePayout
Case 2
txt2.Text = FinalBasePayout
Case 3
txt3.Text = FinalBasePayout
'... Repeat for Cases 4 through 29
Case 30
txt30.Text = FinalBasePayout
End Select
End Sub
There has to be a more efficient way than this method that takes over 65 lines of code!
Thanks in advance!
Regards,
Eric
I have the following block of code, but I am hoping there is a more simple way to set the textbox?
Here is the code:
Private Sub SetValueOfPosition(ByVal FinalBasePayout, ByVal Position)
Select Case Position
Case 1
txt1.Text = FinalBasePayout
Case 2
txt2.Text = FinalBasePayout
Case 3
txt3.Text = FinalBasePayout
'... Repeat for Cases 4 through 29
Case 30
txt30.Text = FinalBasePayout
End Select
End Sub
There has to be a more efficient way than this method that takes over 65 lines of code!
Thanks in advance!
Regards,
Eric
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Bchoor,
I'll try it! Thanks!
I'll try it! Thanks!
ASKER
Works perfectly! Thanks!
Dim txtBox As TextBox = CTYPE(Me.FindControl("txt"
txtBox.Text = FinalBasePayout