Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Messagebox alternative
Message
 
To
28/06/2005 11:50:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01027085
Message ID:
01027117
Views:
16
Perhaps this might be of use.
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.
>Is there a MessageBox alternative which can be centered not in the desktop but in a top-level form?
>
>I have a few small applications which are top-level forms (SHOWWINDOW = 2) where the top-level forms are quite small. MessageBox centers the box in the desktop, so what happens is that the messagebox can appear on the desktop far away from the application that created it. (Odd effect indeed if other apps are visible as well, as it appears on top of them ...)
>
>I suppose it would be nice as well, as long as I'm looking for an alternative, to hope that it allowed me to specify button captions, font sizes, and other good stuff, but those would just be bonuses.
>
>Thanks in advance
Previous
Reply
Map
View

Click here to load this message in the networking platform