Connecting Tech Pros Worldwide Forums | Help | Site Map

How to check for scroll bars in web browser object?

Brett
Guest
 
Posts: n/a
#1: Nov 21 '05
I'm using the web browser object: SHDocVw.dll. I do this in form Load()

Me.AxWebBrowser1.Navigate("http://www.abc.com/")

Sometimes when a website loads, it causes horizontal or vertical scroll bars
in the web browser window. How can I detect these? I'm assuming they will
be completely run time since they do not appear until after the webpage
loads.

Thanks,
Brett


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 21 '05

re: How to check for scroll bars in web browser object?


"Brett" <no@spam.com> schrieb:[color=blue]
> I'm using the web browser object: SHDocVw.dll. I do this in form Load()
>
> Me.AxWebBrowser1.Navigate("http://www.abc.com/")
>
> Sometimes when a website loads, it causes horizontal or vertical scroll
> bars in the web browser window. How can I detect these? I'm assuming
> they will be completely run time since they do not appear until after the
> webpage loads.[/color]

The scrollbars are part of the document which is shown inside the control.
You can remove them in the 'DocumentComplete' event using
'Me.WebBrowser1.Document.body.scroll = "no"'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Brett
Guest
 
Posts: n/a
#3: Nov 21 '05

re: How to check for scroll bars in web browser object?



"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:ezTL8DVOFHA.2348@tk2msftngp13.phx.gbl...[color=blue]
> "Brett" <no@spam.com> schrieb:[color=green]
>> I'm using the web browser object: SHDocVw.dll. I do this in form Load()
>>
>> Me.AxWebBrowser1.Navigate("http://www.abc.com/")
>>
>> Sometimes when a website loads, it causes horizontal or vertical scroll
>> bars in the web browser window. How can I detect these? I'm assuming
>> they will be completely run time since they do not appear until after the
>> webpage loads.[/color]
>
> The scrollbars are part of the document which is shown inside the control.
> You can remove them in the 'DocumentComplete' event using
> 'Me.WebBrowser1.Document.body.scroll = "no"'.
>[/color]

The above line gives a run-time error because intellisense doesn't show
anything after document.

I'm trying to set a certain width and detect if the webpage has gone past
that width. I can set my form to say 800 width. If the webpage is wider,
it will scroll out of viewing area tothe right, as the web browser object
seems to grow dynamically. It will grow past the form width depending on
the web page. How can I check for that?

Thanks,
Brett


Closed Thread