Can we change the font size through code behind?
I need to change the font size of 开发者_StackOverflow社区bold thing below. I have a css for use but this bold part needs font changed to 8px instead of 10(css). i want someone to help me with how to change in Code behind.
string newpackname = dschkdowngraded.Tables[0].Rows[0]["ChangedTo"].ToString();
DateTime dt = Convert.ToDateTime(dschkdowngraded.Tables[0].Rows[0]["TakesAffect"]);
dt = dt.Date;
// need to change what is inside the ()
string packname = accountSummary.PackageName + " (Downgraded to "
+ newpackname + ". Effective from " + dt + ")";
Css is here:
float: left;
padding-right: 10px;
color: #0d7194;
font-weight: bold;
You can have two css classes, then change the css class propery ofr the relevant label.
myLabel.CssClass = "someClass";
Use CSS for this, when you do it in your codebehind you need to build and deploy whenever you want to change the font size. With CSS you can just change it.
Give the labels that need a smaller text an other class like Tom Gullen suggests
精彩评论