Jump to content
Sign in to follow this  
Kaba

Remove inactive right scroll bar from HTML viewer

Recommended Posts

Kaba

Hi,

I use the following code to view a HTML file :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
 
$file = @ScriptDir &"\test.html"
$obj = ObjCreate("shell.Explorer.2")
$GUI = GUICreate("GUI", 300, 200, 100, 100)
 
GUICtrlCreateObj($obj,10, 10,280,150)
$obj.navigate($file)
 
GUISetState(@SW_SHOW)
 
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

This is the very basic HTML file I view with it:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>  <meta content="text/html; charset=ISO-8859-1"http-equiv="content-type">  <title>Test</title></head><body>Test</body></html>

The thing that annoys me is that the window always shows an inactive scrollbar on the right side.

Posted Image

Is there a way to remove the inactive scroll bar from the right side?

Kaba

Share this post


Link to post
Share on other sites
Kaba

Just trying hard to find an answer to that question.

Does anyone know if the side scroll bar can be removed or if this is property just can't be changed with autoit?

If I knew that it simply isn't possible, this would help me as well.

Kaba

Share this post


Link to post
Share on other sites
hannes08

$obj.document.body.scroll = "no"

Untested. :graduated:


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites
Kaba

Hi Hannes,

thank you for your help.

I added it to the code. But, unfortunatly this doesn't remove the inactive side scrollbar.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
 
$file = @ScriptDir &"\test.html"
$obj = ObjCreate("shell.Explorer.2")
$GUI = GUICreate("GUI", 300, 200, 100, 100)
 
GUICtrlCreateObj($obj,10, 10,280,150)
$obj.navigate($file)
$obj.document.body.scroll = "no"
 
GUISetState(@SW_SHOW)
 
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

The thing I find strange is that I found where JohnOne had the same problem but with the vertical scrollbar.

But, no Horizontal right side bar is shown in his example.

Here's his code:

#include <IE.au3>
$hGui = GUICreate("",400,600,100,50)
$Obj = ObjCreate("Shell.Explorer.2")
$CtrlObj = GUICtrlCreateObj($Obj,5,5,350,590)
GUISetState()
;$Obj.Navigate2("http://www.google.com")
_IENavigate($Obj, "www.google.com")
_IELoadWait($Obj)
$Obj.document.body.scroll = "no"
Sleep(10000)

He worked with '_IENavigate' instead of '$obj.navigate($file)' and I thought that this could be the solution.

But it isn't. I tried his code with my sample HTML file.

And the result is the same: no horizontal scroll bar but the one at the vertical right side.

Strange.

Share this post


Link to post
Share on other sites
Kaba

Just trying to keep this post active.

Does really have an idea how to prevent the autoit webbrowser from showing scrollbars without using

$obj.document.body.scroll = "no"

Because this doesn't seem to work in my example.

Or am I using it wrong?

Kaba

Share this post


Link to post
Share on other sites
AdmiralAlkex

Can you edit the html file? Then you can add "SCROLL=NO" in the body tag to remove the scrollbars

http://www.htmlcodetutorial.com/document/_BODY_SCROLL.html

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites
Kaba

Yipiiii,

thank you Admiral Alkex!!!!!

This is the answer.

Yes I can edit the shown html files. I had tried to do that with the css overflow property but this didn't work.

The "SCROLL=NO" tag is the solution to my problem.

Thank you very much!

Kaba

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×