BackColor on Label doesn't seem to work

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

Why doesn't BackColor on a label work (ForeColor works):

Dim theAnswer as Label
theAnswer.ForeColor = System.Drawing.Color.yellow
theAnswer.BackColor = System.Drawing.Color.green

BackColor on DataGridItem works fine.

Dim oGridItem as DataGridItem
oGridItem.BackColor = System.Drawing.Color.green

Thanks,

Tom
 
It works here...

theAnswer.ForeColor = System.Drawing.Color.Yellow
theAnswer.BackColor = System.Drawing.Color.Green

renders as


<span id="theAnswer"
style="color:Yellow;background-color:Green;">Label</span>

Is there a stylesheet or something that is getting in the way?

Ken
 
Ken Cox said:
It works here...

theAnswer.ForeColor = System.Drawing.Color.Yellow
theAnswer.BackColor = System.Drawing.Color.Green

renders as


<span id="theAnswer"
style="color:Yellow;background-color:Green;">Label</span>

Is there a stylesheet or something that is getting in the way?

That is possible. There is a style sheet. I will need to spend some time
trying to get it to work by backing out parts of the stylesheet.

Thanks,

Tom
 
Tom, the style sheet shouldn't override the node's style. Before you spend
time dismembering your css, take a look at the generated HTML for your page
to see if your color setting is getting rendered.

If not, there's likely a bug in your code that some basic breakpoints and
tracing can locate quickly.

/// M
 
Back
Top