I am making a table to checking manual input video info. If input doc (xxx.xml) is not found, it will turn the text boxes background color red and front color white.
Problem
When user delete the incorrect input segment, it won't do input checking and the textbox will reset to white background color and black front color. However, the duration column did not clear the css changes and get a bug which another 2 textboxes turn red when mouse hover on them.
If I use Drawing.Color.Empty
the duration will change front color to white and hidden the text. Does anyone know how to fix it?
Remark: only 1 use empty (XXX.BackColor = Drawing.Color.Empty
, XXX.ForeColor = Drawing.Color.Black
) is not work, both become empty.
CODE
Dim FileName As RadTextBox = CType(r.FindControl("txtFileName"), RadTextBox) 'mxf
Dim timeIn As RadTextBox = CType(r.FindControl("txtTimeIn"), RadTextBox)
Dim timeOut As RadTextBox = CType(r.FindControl("txtTimeOut"), RadTextBox)
Dim Duration As RadTextBox = CType(r.FindControl("txtDuration"), RadTextBox)
If FileName.Text <> "" Then
// Red bg warning for incorrect input
Else
// Reset empty semgment textbox color
FileName.BackColor = Drawing.Color.White
FileName.ForeColor = Drawing.Color.Black
timeIn.BackColor = Drawing.Color.White
timeIn.ForeColor = Drawing.Color.Black
timeOut.BackColor = Drawing.Color.White
timeOut.ForeColor = Drawing.Color.Black
Duration.BackColor = Drawing.Color.White
Duration.ForeColor = Drawing.Color.Black
End If
I am making a table to checking manual input video info. If input doc (xxx.xml) is not found, it will turn the text boxes background color red and front color white.
Problem
When user delete the incorrect input segment, it won't do input checking and the textbox will reset to white background color and black front color. However, the duration column did not clear the css changes and get a bug which another 2 textboxes turn red when mouse hover on them.
If I use Drawing.Color.Empty
the duration will change front color to white and hidden the text. Does anyone know how to fix it?
Remark: only 1 use empty (XXX.BackColor = Drawing.Color.Empty
, XXX.ForeColor = Drawing.Color.Black
) is not work, both become empty.
CODE
Dim FileName As RadTextBox = CType(r.FindControl("txtFileName"), RadTextBox) 'mxf
Dim timeIn As RadTextBox = CType(r.FindControl("txtTimeIn"), RadTextBox)
Dim timeOut As RadTextBox = CType(r.FindControl("txtTimeOut"), RadTextBox)
Dim Duration As RadTextBox = CType(r.FindControl("txtDuration"), RadTextBox)
If FileName.Text <> "" Then
// Red bg warning for incorrect input
Else
// Reset empty semgment textbox color
FileName.BackColor = Drawing.Color.White
FileName.ForeColor = Drawing.Color.Black
timeIn.BackColor = Drawing.Color.White
timeIn.ForeColor = Drawing.Color.Black
timeOut.BackColor = Drawing.Color.White
timeOut.ForeColor = Drawing.Color.Black
Duration.BackColor = Drawing.Color.White
Duration.ForeColor = Drawing.Color.Black
End If
Share
Improve this question
edited Feb 4 at 9:35
Matthew
asked Feb 4 at 9:03
MatthewMatthew
156 bronze badges
1 Answer
Reset to default 0Use
XXX.DisabledStyle.BackColor
XXX.HoveredStyle.BackColor
XXX.FocusedStyle.BackColor
instead of XXX.BackColor
(ForeColor same method)
Ref:
- https://www.telerik/forums/radtextbox-changing-color-on-mouseover-for-no-reason
- https://www.telerik/products/aspnet-ajax/documentation/controls/textbox/appearance-and-styling/styles