# WebBrowserComponent can't fit to specific bounds

**URL:** <https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159>\
**Category:** Windows\
**Created:** [January 8, 2014, 8:52am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159 "2014-01-08T08:52:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![flyinbirdf](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@flyinbirdf](https://forum.juce.com/u/flyinbirdf)\
**Post date:** [January 8, 2014, 8:52am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159/1 "2014-01-08T08:52:33Z")

</div>

I need to show the full web page with specific bounds. But there have no method in&nbsp;WebBrowserComponent class. I find the windows API imported in JUCE library, and the put\_FullScreen & put\_Resizable methods in the SDK. but when I call browser-\>put\_FullScreen(true) method and browser-\>put\_Resizable() method, the web page showed in&nbsp;WebBrowserComponent can't fit to the component bounds. I want to check if there already have methods in windows SDK or JUCE code to fit the web page to specific bounds? wait for your response, thanks.

---

<div class="post-metadata">

**Author:** ![flyinbirdf](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@flyinbirdf](https://forum.juce.com/u/flyinbirdf)\
**Post date:** [January 8, 2014, 8:55am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159/2 "2014-01-08T08:55:56Z")

</div>

BTW, the effect of the needed methods is the same to the "ZOOM" function of IE.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 8, 2014, 10:16am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159/3 "2014-01-08T10:16:00Z")

</div>

Sorry, I can't understand what you mean..? If you want the component to be a certain size, just resize the WebBrowserComponent normally (??) There's no need to call directly into the win32 stuff.

---

<div class="post-metadata">

**Author:** ![flyinbirdf](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@flyinbirdf](https://forum.juce.com/u/flyinbirdf)\
**Post date:** [January 9, 2014, 1:38am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159/4 "2014-01-09T01:38:01Z")

</div>

I'm sorry no describe this problem clearly.

The code show as bellow:

WebComponent::WebComponent()  
{  
&nbsp;&nbsp; &nbsp;\_url = "http://www.bing.com";  
&nbsp;&nbsp; &nbsp;int width = getWidth();  
&nbsp;&nbsp; &nbsp;int height = getHeight();  
&nbsp;&nbsp; &nbsp;\_webBrowserComponent = new WebBrowserComponent();  
&nbsp;&nbsp; &nbsp;\_webBrowserComponent-\>setBounds(0,0,width,height);  
&nbsp;&nbsp; &nbsp;\_webBrowserComponent-\>goToURL(\_url);  
&nbsp;&nbsp; &nbsp;addAndMakeVisible(\_webBrowserComponent);  
}  
void WebComponent::resized()  
{  
&nbsp;&nbsp; &nbsp;int width = getWidth();  
&nbsp;&nbsp; &nbsp;int height = getHeight();  
&nbsp;&nbsp; &nbsp;\_webBrowserComponent-\>setBounds(0, 0, width, height);  
}  
I set the bounds of&nbsp;WebBrowserComponent to certain size and call "goToURL" method to show the page on this component. But the page is more larger than the component size. So it will show scroll bar on the right side and bottom side of this component and just a little part of this web page show in the bounds of&nbsp;this component. I want to show the total web page in the bounds of this component and no scroll bar need to be show.&nbsp;

---

<div class="post-metadata">

**Author:** ![flyinbirdf](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@flyinbirdf](https://forum.juce.com/u/flyinbirdf)\
**Post date:** [January 9, 2014, 1:47am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159/5 "2014-01-09T01:47:24Z")

</div>

The problem picture and picture with needed effect show in the attachment.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 9, 2014, 10:33am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159/6 "2014-01-09T10:33:58Z")

</div>

What you're asking has nothing at all to do with the way the browser's position, it's entirely a question of making your web content fit inside the browser. It's HTML/JS you need to be changing, not the browser.

---

<div class="post-metadata">

**Author:** ![flyinbirdf](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@flyinbirdf](https://forum.juce.com/u/flyinbirdf)\
**Post date:** [January 13, 2014, 6:09am UTC](https://forum.juce.com/t/webbrowsercomponent-cant-fit-to-specific-bounds/12159/7 "2014-01-13T06:09:00Z")

</div>

I am not familiar with HTML/JS, so I am confused before. Thank you for your response and I will tell my colleague who is responsible for HTML/JS.
