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

Un nouveau style de messagebox()   



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

Un nouveau style de messagebox()
# 0000000109
ajouté le 01/12/2004 22:40:56 et modifié le 01/12/2004
consulté 7628 fois
Niveau initié

Version(s) Foxpro :
VFP 7.0

Description

Voici un nouveau style de messagebox() qui utilise l'internet Explorer

Code source :
objShell = CreateObject("WScript.Shell")
Declare Sleep In kernel32 Integer dwMilliseconds
objIE = Createobject("InternetExplorer.Application")
strIETitle ="Message box"
strMsg ="This is my new style message box"
With objIE
    .Toolbar = .F.
    .StatusBar = .F.
    .Resizable = .F.
    .Navigate("about:blank")
    With .Document
        With .ParentWindow
            intWidth = .Screen.AvailWidth
            intHeight = .Screen.AvailHeight
            intWidthW = .Screen.AvailWidth * .40
            intHeightW = .Screen.AvailHeight * .05
            .resizeto(300,200)
            .moveto( (.Screen.AvailWidth)/6, (.Screen.AvailHeight)/6)
        Endwith
        .Write( "<body> " + strMsg + " </body></html>")
        With .ParentWindow.Document.body
            .Style.backgroundcolor = "LightBlue"
            .Scroll="no"
            .Style.Font = "20pt 'Arial'"
            .Style.BorderStyle = "outset"
            .Style.BorderWidth = "4px"
        Endwith
        .Title = strIETitle
        =Sleep(100)
        objShell.AppActivate(strIETitle)
    Endwith
Endwith
objIE.Visible = .T.

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