INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Forms & Screen

A quick form to Show your HTML files within VFP by ramani
Posted: 6 Oct 03

A quick form to show your HTML files within VFP.  
1. If you pass a html file name with path as parameters, the form will show the file without a file selection choice. If no parameters sent, the button will be auto displayed to choose a HTML file.
2. Cut and paste the following to a prg.. say..
gsHtml.prg
And RUN it from command window or call it from another prg..
=gsHtml()  or  =gsHtml("cHtmlFileName")
**********************************************************
** Form to display HTML files.
**********************************************************
** Author      : Ramani (Subramanian.G)
**               FoxAcc Software / Winners Software
** Type        : Freeware with reservation to Copyrights
** Warranty    : Nothing implied or explicit
**********************************************************
PARAMETERS tFile

PUBLIC oform1

oform1=NEWOBJECT("form1")

IF VARTYPE(cFile) # "U"
   oForm1.cmdFile.Visible = .f.   
   oForm1.cmdExit.Visible = .f.   
   oForm1.oleControl1.Top = 12
   oForm1.oleControl1.LoadDocument([&cFile])
ENDIF

oform1.Show
RETURN
**********************************************************
DEFINE CLASS form1 AS form

   DoCreate = .T.
   Caption = "HtmlForm"
   Name = "Form1"

   ADD OBJECT cmdfile AS commandbutton WITH ;
      Top = 12, ;
      Left = 12, ;
      Height = 27, ;
      Width = 144, ;
      Caption = "Select File", ;
      Name = "cmdFile"

   ADD OBJECT cmdexit AS commandbutton WITH ;
      Top = 12, ;
      Left = 168, ;
      Height = 27, ;
      Width = 84, ;
      Caption = "E\<xit", ;
      Name = "cmdExit"

   ADD OBJECT olecontrol1 AS olecontrol WITH ;
      OLEClass = "DHTMLEdit.DHTMLEdit.1", ;
      Top = 48, ;
      Left = 12, ;
      Height = 192, ;
      Width = 348, ;
      Name = "Olecontrol1"

   PROCEDURE Init
      ThisForm.ReSize()
   ENDPROC

   PROCEDURE Resize
      ThisForm.Olecontrol1.Height = ThisForm.Height - 60
      ThisForm.Olecontrol1.Width = ThisForm.Width - 24
      ThisForm.Olecontrol1.Refresh()
   ENDPROC

   PROCEDURE cmdfile.Click
      LOCAL cFile
      cFile = GETFILE([HTM*])
      IF !EMPTY(cFile)
         THISFORM.oleControl1.LoadDocument([&cFile])
      ENDIF
   ENDPROC

   PROCEDURE cmdexit.Click
      ThisForm.Release()
   ENDPROC

ENDDEFINE
**********************************************************
** EOF
**********************************************************

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close