Jump to content
Sign in to follow this  
EKY32

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

Recommended Posts

EKY32

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]

Share this post


Link to post
Share on other sites
Danyfirex

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

Share this post


Link to post
Share on other sites
EKY32

Thank you Mr.Danyfirex !!! I tried that but it didn't work, maybe because I used another integer ( $Y ). Thank you.


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

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  

×