Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web browser (again)
Message
From
23/06/2007 14:56:26
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
23/06/2007 08:45:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01235092
Message ID:
01235197
Views:
26
>>I've got a WebBrowser ActiveX control (oWB) on a VFP form. After I oWB.navigate2("about:blank") I do a oWB.document.write(some HTML here...) and all is fine, except:
>>
>>I don't want the disabled vertical scrollbar showing. In the past, I've eliminated it by setting
<body scroll="no">
when I created an actual HTML file to navigate to. Now that I'm writing directly to the document, I cannot seem to access the body to try to set scroll="no".
>>
>>I then created a simple HTML file that contained:
>>
>>
>><html>
>>   <head>
>>   </head>
>>   <body scroll="no">
>>   </body>
>></html>
>>
>>
>>After navigating to it I figured that I could document.write(whatever html here) and that the HTML that I'd written out would simply be put into the content of the body. Wrong! The HTML that was there from the temporary file was replaced.
>>
>>Does anyone know how I can preserve the content of my temporary HTML file and then do a document.write to fill in the body? If not, how can I manipulate the body attributes (like scroll="no") with document.write()?
>>
>>TIA.
>>Mike
>
>Mike,
>Not sure I understood. Both are working for me:
>
>public oForm
>oForm = newobject('HTMLViewerForm')
>oForm.show
>with oForm.htmlviewer
>  .navigate2("about:blank")
>  .document.write('<html><body scroll="no"></body></html>')
>  .document.body.innerHTML = '<b>This is new content</b>'
>endwith
>
>define class HTMLViewerForm as form
>  height = 500
>  width = 800
>  add object htmlviewer as olecontrol with ;
>    height = 500, width = 800, visible = .t., ;
>    oleclass = 'Shell.Explorer'
>
>  procedure htmlviewer.refresh
>    nodefault
>  endproc
>enddefine
>
>
>Or:
>
>public oForm
>lcFile = fullpath("base.htm") && your HTML content
>oForm = newobject('HTMLViewerForm')
>oForm.show
>with oForm.htmlviewer
>  .navigate2(m.lcFile)
>  do while .readyState != 4
>  enddo
>  .document.body.InnerHTML = "<b>This is new HTM</b>"
>endwith
>
>define class HTMLViewerForm as form
>  height = 500
>  width = 800
>  add object htmlviewer as olecontrol with ;
>    height = 500, width = 800, visible = .t., ;
>    oleclass = 'Shell.Explorer'
>
>  procedure htmlviewer.refresh
>    nodefault
>  endproc
>enddefine
>
Cetin

Hey Cetin,

My mistake. I didn't try to write the entire HTML starting from HTML tags. I was only writing the body's content. Blame it on a brain cramp!

Thanks,
Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform