Jump to content

Remove inactive right scroll bar from HTML viewer


Kaba
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...