leearach2004
Technical User
Hi there I am new to creating mobile web applications using vs 2005.
I wish to change the background colour of a mobile text box at runtime, displaying green background if the value is 1 and red if it is 0.
I can change the background of the whole form by using
this changes the forms background fine but i want to change the text box background
I have tried using
this does not show any errors and the option ios their to use the property but it does not change the textbox colour
My code is as follows
hope somone can help cant seem to find anything on the net about it
lee
I wish to change the background colour of a mobile text box at runtime, displaying green background if the value is 1 and red if it is 0.
I can change the background of the whole form by using
Code:
if(textbox.text = 1)
me.fomr1.BackColor = Drawing.Color.LightGreen
else
me.fomr1.BackColor = Drawing.Color.Red
end if
I have tried using
Code:
me.textBox1.BackColor = Drawing.Color.Red
My code is as follows
Code:
Protected Sub oblstRec_ItemSelect(ByVal sender As Object, ByVal e As System.Web.UI.MobileControls.ObjectListSelectEventArgs) Handles oblstRec.ItemSelect
Me.ActiveForm = frmRes
lblpartn.Text = e.ListItem.Item("PartNumber")
txtpartn.Text = e.ListItem.Item("PartName")
txtcon.Text = e.ListItem.Item("Condition")
txtloc.Text = e.ListItem.Item("Location")
txtquan.Text = e.ListItem.Item("Quantity")
txtval.Text = e.ListItem.Item("Valid")
If (txtval.Text = 0) Then
txtval.BackColor = Drawing.Color.Red
Else
txtval.BackColor = Drawing.Color.LightGreen
End If
End Sub
hope somone can help cant seem to find anything on the net about it
lee