Sign in to follow this  
Followers 0
Shaarad

Scrolling a locked GUI control

5 posts in this topic

I am making a GUI in which I have an Embedded Internet Explorer object to display web pages. I want the control to be locked. What I mean by 'locked' is that user should not be able to type anything in the textboxes on the page and should not be able to click any buttons on it. However, I want that the user should only be able to scroll the control in order to view its contents completely. I have tried using

GUICtrlSetStyle($GUIActiveX,$WS_DISABLED)

on the control but it also locks the scrollbar of that control. Is there any way to enable just the scrollbar of that control or add another scrollbar to control it?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites



can u give the full code


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

should not be able to type anything in the textboxes

Well if you just want to block the textboxes then this code will be useful :)

#include <IE.au3>
Local $sURL = "www.autoitscript.com/forum/topic/142719-scrolling-a-locked-gui-control/"
Global $_IE_Obj=_IECreate($sURL,0,0,1,1)
Local $_Hwnd=_IEPropertyGet( $_IE_Obj, 'hwnd')
_BlockControlById("main_search")
WinSetState($_Hwnd,'',@SW_SHOWMAXIMIZED)
WinActivate($_Hwnd,'')
Sleep(50000)
_IEQuit($_IE_Obj)

Func _BlockControlById($_Id)
Local $_obj_Document=_IEDocGetObj($_IE_Obj)
$_obj_Document.getElementById($_Id).Disabled = True ;
EndFunc

The following code disables the search box of this same site.

I prefer to block the textboxes instead because the scrollbar dont seem to have any specific unique ID

This code should also work with Buttons

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#include <IE.au3>
Local $sURL = "www.autoitscript.com/forum/topic/142719-scrolling-a-locked-gui-control/"
Global $_IE_Obj=_IECreate($sURL,0,0,1,1)
Local $_Hwnd=_IEPropertyGet( $_IE_Obj, 'hwnd')
WinSetState($_Hwnd,'',@SW_SHOWMAXIMIZED)
WinActivate($_Hwnd,'')
Local $_Timer=TimerInit()
Local $_Diff
While $_Diff<10000
$_Diff=TimerDiff($_Timer)
ToolTip('Blocking After '&Round(10-($_Diff/1000))&' Seconds.',Default,Default,'Count-Down',1,7)
WEnd
_BlockControlById("main_search",True)
ToolTip('Edit Blocked',Default,Default,'Information',1,7)
Sleep(2000)
$_Timer=TimerInit()
$_Diff=TimerDiff($_Timer)
While $_Diff<10000
$_Diff=TimerDiff($_Timer)
ToolTip('UnBlocking After '&Round(10-($_Diff/1000))&' Seconds.',Default,Default,'Count-Down',1,7)
WEnd
_BlockControlById("main_search",False)
ToolTip('Edit UnBlocked',Default,Default,'Information',1,7)
Sleep(2000)
ToolTip('')
Sleep(20000)
_IEQuit($_IE_Obj)

Func _BlockControlById($_Id,$sBlock=True)
Local $_obj_Document=_IEDocGetObj($_IE_Obj)
$_obj_Document.getElementById($_Id).Disabled = $sBlock ;
EndFunc
This will explain in a more efficient way :)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

it solved the problem...thanks a lot! :ILA2:


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  
Followers 0