We help IT Professionals succeed at work.

Webbrowser control font size ??

Medium Priority
596 Views
Last Modified: 2013-12-03
HI guys,

I have a webbrowser control on a form.
Access 2003.,
is there any way to control the size of the text in the webbrowser control like
you would in internet explorer ?
I am trying to make the size of the screen as small as possible..
in internet explorer i would just click on View/Text Size/ and then medium, small , large or what ever.
I do not need the use of the variable size., I just need to make it smaller than it already is.

thanks,
kevin
Comment
Watch Question

Alan WarrenApplications Developer

Commented:
Hi Kevin,

you could encapsulate your text in a <Font> tag to render fonts in a web-browser control.

<p>
<font size="2" face="Verdana">
This is a paragraph.
</font>
</p><p>
<font size="3" face="Times">
This is another paragraph.
</font>
</p>

Alan ":0)

Author

Commented:
i don't see how that is going to change the font size in a webbrowser element in a form.

kevin
Alan WarrenApplications Developer

Commented:
Hi Kevin,

could you explain a little about your intended purpose for your web-browser?
What  are you trying to display?

Alan

Author

Commented:
it displays the web page address that the user puts in the form.

Author

Commented:
how do i close this question without awarding any points, since it has not been answered ??

kevin rea
MIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012
Commented:
Try this first...

From this MS link:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/WebBrowser/WebBrowser.asp

Changing Fonts with the WebBrowser Control
The WebBrowser automation model does not support a method that allows you to change the font of the text of the currently displayed page. However, the WebBrowser control exposes this functionality through the IOleCommandTarget interface. Call the IWebBrowser2::get_Document method, which returns an IDispatch pointer. Using this IDispatch pointer, call QueryInterface on IID_IOleCommandTarget. With this IOleCommandTarget interface pointer, call IOleCommandTarget::Exec with OLECMDID_ZOOM and use the pvaIn input argument to pass a value in the range of 0 to 5 (where 0 is smallest), indicating the desired scale of the font. This, in effect, mimics the functionality available through the Internet Explorer Fonts command on the View menu.

This is your answer, straight from Microsoft.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
Glad i could help!

Thanks for the grade!
:)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.