Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using FFC Hyperlink Label for MAILTO in VFP6
Message
De
07/09/1999 13:16:03
 
 
À
07/09/1999 11:02:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00261951
Message ID:
00262028
Vues:
16
>I'm trying to figure out how to use a FFC Hyperlink Label class to provide a MAILTO link on a form (e.g., 'mailto:fred@splat.com'). The problem is that the class seems to prepend 'http://' to the font of the URL if it isn't already there, which makes the browser ignore the 'MAILTO' part.
>
>Can this not be done with Hyperlink Label, or am I perhaps not setting something correctly?
>
>-- jas

I think the FFC Hyperlink class is pretty geared toward URLs. You can create your own hyperlink label class pretty easily though. Just create a subclass of your label class and add a new property called HREF. Then in the click event of the label, put some code like this:

lcHREF = IIF(EMPTY(THIS.HREF), THIS.Caption, THIS.HREF)
IF EMPTY(lcHREF)
RETURN
ENDIF
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
=ShellExecute(0,"Open",lcHREF,"","",1)

This label will work with any string that can be executed with Shellexecute; it doesn't assume any http or mailto or anything. You just need to assure that the href property (or the caption if you want to show the address) contains the correct string.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform