How can I change the font size of a vb2010 webbrowser control
Posted on 2014-01-28
We have a Webbrowser control embedded in a VB2010 app to display html files, and would like to allow the user to change the appearance of the displayed content by providing menu items to change the font type and size. We are using the following line to set the options:
WebBrowser1.Document.Body.Style = "font-family" & FontName & ";font-size=" & FontSize & "px;"
This works fine for changing the font family using "Ariel", "Courier", etc. but nothing changes when setting the font size. I've tried "font-size=8px;", I've tried using 0-5 as in "font-size=1;", but nothing works.
Anyone have any idea what to do to change the current font?