WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

WebBrowser

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Disable Scrollbar in WebBrowser Dialog Control


Question:

I wonder how I can remove the scroll bar in the Shell.Explorer box in a Dialog. I dont want to have the scroll bar in X and Y direction

Answer:

WB has a few addon properties for the WebBrowser control so try the following
; Get the control's object. 
objWebBrowser = DialogObject(Dialog_Handle, 001, DLGOBJECT_GETOBJECT, "", 0)

; Turn off scollbars.
objWebBrowser.document.parentWindow.external.Scrollable = @FALSE
There is more info on addon properties at the bottom of the "dialog" function topic page in the help file. Here is a Working example:

#DefineSubRoutine NoScroll(hHandle, nMessage, nID, objEventInfo, reserved)

   MSG_INIT             = 0
   MSG_COMEVENT         = 14 ;COM control event fired.

   ; Options for DialogObject
   DLGOBJECT_ADDEVENT   = 1 ; DialogObject add event.
   DLGOBJECT_REMOVEVENT = 2 ; DialogObject remove event.
   DLGOBJECT_GETOBJECT  = 3 ; DialogObject get reference to object.
   DLGOBJECT_GETPICTURE = 4 ; DialogObject get a picture object.

   Switch nMessage
   Case MSG_INIT

      ; Need to hook the "NavigateComplete2" event because document
      ; object does not exist yet.
      DialogObject(hHandle, 003, DLGOBJECT_ADDEVENT,  "NavigateComplete2", 003001)
      Return -1
  Case  MSG_COMEVENT

        ; Turn off scrollbars when navigation is complete event fires.
      objWebBrowser = DialogObject(hHandle, 003, DLGOBJECT_GETOBJECT, "", 0)
      objWebBrowser.document.parentWindow.external.scrollable = @FALSE
      objWebBrowser = 0
      Return -1
   EndSwitch
   Return -1
#EndSubRoutine

MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`WIL Dialog 1`
MyDialogX=001
MyDialogY=001
MyDialogWidth=302
MyDialogHeight=219
MyDialogNumControls=003
MyDialogProcedure=`NoScroll`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`077,201,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`189,201,036,012,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`003,003,294,188,COMCONTROL,DEFAULT,"http://winbatch.com/",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")


Article ID:   W16936
File Created: 2013:09:06:08:50:10
Last Updated: 2013:09:06:08:50:10