K
Ken Varn
I have a WebControl in which I apply a Style using the ApplyStyle method.
This Style has Style.BackColor set to a valid color. When I pass it to the
Control.ApplyStyle() method, it seems to work fine on the first call.
However, if I try to apply a new Style object with no background color set,
the background color remains the same and is not removed.
Example:
{
Style MyStyle = new Style();
MyStyle.backColor = Color.Red;
MyControl.ApplyStyle(MyStyle);
MyStyle = new Style();
MyStyle.Reset();
MyStyle.ForeColor = Color.Black;
MyControl.ApplyStyle(MyStyle);
// At this point, if I render MyControl, the background color will still
be red. Why?
}
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------
This Style has Style.BackColor set to a valid color. When I pass it to the
Control.ApplyStyle() method, it seems to work fine on the first call.
However, if I try to apply a new Style object with no background color set,
the background color remains the same and is not removed.
Example:
{
Style MyStyle = new Style();
MyStyle.backColor = Color.Red;
MyControl.ApplyStyle(MyStyle);
MyStyle = new Style();
MyStyle.Reset();
MyStyle.ForeColor = Color.Black;
MyControl.ApplyStyle(MyStyle);
// At this point, if I render MyControl, the background color will still
be red. Why?
}
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------