ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Ajouter un Web Browser fonctionnel dans le _SCREEN de VFP avec shell.explorer   



L'auteur

Mike Gagnon
Canada Canada
Membre Simple
# 0000000025
enregistré le 14/10/2004

Gagnon Mike
Pointe Cla H9R 3K8
de la société Carver Technologies Inc.
Fiche personnelle


Note des membres
pas de note

Contributions > 09 - Automation

Ajouter un Web Browser fonctionnel dans le _SCREEN de VFP avec shell.explorer
# 0000000207
ajouté le 07/06/2005 19:12:19 et modifié le 07/06/2005
consulté 7832 fois
Niveau initié

Version(s) Foxpro :
VFP 9.0
VFP 8.0

Description

Voici comment ajouter la fonctionalité du Web Browser dans le fond de l'écran FoxPro.

Code de Calvin Hsia

Note pour VFP8.0 enlever le paramètre autocomplete dans la ligne suivante

Add Object

txtURL As TextBox With Width=400,Value="www.atoutfox.org",Autocomplete=3

Code source :
Public ox
ox=Newobject("myformx")
Bindevent(_Screen,"resize",ox,"resize")
ox.Show
Define Class myformx As Form
  Add Object txtURL As TextBox With Width=400,Value="www.atoutfox.org",Autocomplete=3
  Add Object cmdRefresh As CommandButton With Caption="\<Rafraichir",Left=400,Height=20
  Add Object cmdBack As CommandButton With Caption="\<Reculer",Left=500,Height=20
  Add Object cmdForward As CommandButton With Caption="\<Avancer",Left=600,Height=20
  Add Object oweb As cweb With Top=30
  Width=800
  Height=800
  AlwaysOnBottom=.T.
  AllowOutput=.F.
  TitleBar=0
  Procedure Init
    This.oweb.Width=Thisform.Width
    Thisform.Resize
    This.oweb.Height=Thisform.Height-Thisform.txtURL.Height-2
    Thisform.txtURL.Valid
  Endproc
  Procedure Resize
    Thisform.Width=_Screen.Width
    Thisform.Height=_Screen.Height
    This.oweb.Top=30
    This.oweb.Height=Thisform.Height-100
    This.oweb.Width=Thisform.Width-Thisform.Left
  Endproc
  Procedure txtURL.Valid
    Thisform.oweb.Navigate(This.Value)
  Endproc
  Procedure cmdRefresh.Click
    Thisform.oweb.Refresh
  Endproc
  Procedure cmdBack.Click
    Try
      Thisform.oweb.GoBack()
    Catch
    Endtry
  Endproc
  Procedure cmdForward.Click
    Try
      Thisform.oweb.GoForward()
    Catch
    Endtry
  Endproc
Enddefine

Define Class cweb As OleControl
  OleClass="shell.explorer.2"
  Procedure Refresh
    Nodefault
Enddefine

Commentaires
Aucun commentaire enregistré ...

Publicité

Les pubs en cours :


www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2024.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3