Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web browser (again)
Message
De
23/06/2007 08:45:47
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/06/2007 14:48:47
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
01235092
Message ID:
01235168
Vues:
34
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform