I am trying to increase or decrease the displayed texts font.
but can only get it to increase once or decrease once then it stops working.
I am displaying text in web browesers and so i have to increase font size with html tags.
Could someone please direct me in what i’m doing wrong?
private void btnUp_Click(object sender, EventArgs e)
{
HtmlFontPrev = "<font size='+1'>" + webPrevSQL.DocumentText + "</font>";
webPrevSQL.DocumentText = HtmlFontPrev;
HtmlFontPrev = "<font size='+1'>" + webCompareSQL.DocumentText + "</font>";
webCompareSQL.DocumentText = HtmlFontPrev;
}
private void btnDown_Click(object sender, EventArgs e)
{
HtmlFontPrev = "<font size='-1'>" + webPrevSQL.DocumentText + "</font>";
webPrevSQL.DocumentText = HtmlFontPrev;
HtmlFontPrev = "<font size='-1'>" + webCompareSQL.DocumentText + "</font>";
webCompareSQL.DocumentText = HtmlFontPrev;
}
Thanks in advance.
It looks like what’s happening is that the font size is getting reset on each request (that’s normal stateless HTTP behavior). Try saving the increment value on each request by adding it to the session: