ASP and vbs

Associate
Joined
29 Dec 2004
Posts
159
Hi guys,

Im having problems checking textbox values, what i am trying to do is check the value in one textbox with another or maybe a label, then depending on the comparison change the backcolor and forecolor of the textbox. My apologies if you require more info its late and im tired hehe.

Code Below:


Private Sub myTextHandlerHole1(ByVal sender As Object, ByVal e As EventArgs)

Dim StrSender As Object
Dim strParName As Integer
Dim valPar As Integer
Dim strSenderText As Object

StrSender = sender.ID
StrSenderText = sender.ID & ".text"
valPar = Right(StrSender, 1)

strParName = (valPar)

Response.Write(strParName & " " & StrSender)


If strSenderText = (strParName) Then

StrSender.BackColor = Drawing.Color.Green
StrSender.ForeColor = Drawing.Color.White

ElseIf strSenderText = (strParName - 1) Then

StrSender.BackColor = Drawing.Color.LightBlue
StrSender.ForeColor = Drawing.Color.White

ElseIf strSenderText = (strParName + 1) Then

StrSender.BackColor = Drawing.Color.Black
StrSender.ForeColor = Drawing.Color.White

ElseIf strSenderText = (strParName - 2) Then

StrSender.BackColor = Drawing.Color.Yellow
StrSender.ForeColor = Drawing.Color.Black

End If

End Sub
 
Thanks for the help, i ended up using a select case statement and depending on the value of sender modifying the properties of a different object not sure if this is the best way but it works.
 
Back
Top Bottom