Jump to content

~ Buttons To Scroll IE Obj HTML File Up and Down? (SOLVED)


EKY32
 Share

Recommended Posts

I Have this code, I need to hide the scroll bar and I did it, I could make a button to scroll down the page but i couldn't make another to scroll it up, Healp please?

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Text = "Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>"
$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("Form1", 380, 300)
$Label12 = GUICtrlCreateObj($oIE, 10, 10, 353, 259)
$oIE.navigate("")
$oIE.document.write($Text)
$oIE.document.body.scroll = "no"
$oIE.document.body.style.borderWidth = 1
$btn = GUICtrlCreateButton("down", 10, 270, 100, 25)
$btn2 = GUICtrlCreateButton("up", 250, 270, 100, 25)
GUISetState(@SW_SHOW)
$x = 1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $btn
$oIE .document.parentWindow.scrollTo(0, $x + 10)
$x = $x + 10

Case $btn2
; scroll up

EndSwitch
WEnd

Thank you.

Edited by EKY32

[font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font]

Link to comment
Share on other sites

It's very simple. if you add 10 only subtract 10.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Text = "Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>Text<br/>"
$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("Form1", 380, 300)
$Label12 = GUICtrlCreateObj($oIE, 10, 10, 353, 259)
$oIE.navigate("")
$oIE.document.write($Text)
$oIE.document.body.scroll = "no"
$oIE.document.body.style.borderWidth = 1
$btn = GUICtrlCreateButton("down", 10, 270, 100, 25)
$btn2 = GUICtrlCreateButton("up", 250, 270, 100, 25)
GUISetState(@SW_SHOW)
$x = 1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $btn
$oIE .document.parentWindow.scrollTo(0, $x + 10)
$x = $x + 10

Case $btn2
$oIE .document.parentWindow.scrollTo(0, $x - 10)
$x = $x - 10


EndSwitch
WEnd
Edited by Danyfirex
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...