Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to show Browse at run time?
Message
De
09/02/2009 14:11:23
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01380196
Message ID:
01380381
Vues:
61
>Hi,
>
>Is there a way to include a command like Browse in my .EXE that would show records in a cursor? I am looking for a quick and dirty method.
>
>Thank you.

I will show you a really powerful trick I learnt many years ago. There are situations where a grid can be extremely slooow, but a browse can be almost immediate. And sometimes building a separate form with a grid on it just for a quick look is overkill. In those situations this solution is really handy. The trick is to use two browse after each other. This is an example
Use (_foxcode) Again && Or any other table
DEFINE WINDOW FoxWindow FROM 10,10 SIZE 1,1 NAME FoxWindow
FoxWindow.top=50
FoxWindow.left=50
FoxWindow.WIDTH=550
FoxWindow.HEIGHT=500
FoxWindow.Caption='Test'
Browse In Window FoxWindow Save Name FoxBrowse nowait
#if .f.
Public FoxBrowse as Grid && to enable intellisense
#endif
FoxBrowse.left=0
FoxBrowse.top=0
FoxBrowse.width=FoxWindow.width
FoxBrowse.height=FoxWindow.height
FoxBrowse.HighlightStyle= 1
FoxBrowse.HighlightBackColor=0x00ff00
FoxBrowse.setall('DynamicBackColor', 'IIF(Mod(Recno(),2)=0,Rgb(255,255,255),Rgb(170,170,170))')
FoxBrowse.AutoFit()
Activate Window FoxWindow
On Key Label Enter Keyboard '{esc}' Plain
Browse last
On Key Label ENTER
Release Windows FoxBrowse
Release Windows FoxWindow
Messagebox('You picked record no.' + Transform(Recno()) + Chr(13)+Chr(10);
+ 'field 1 is ' + Transform(Evaluate(Field(1))) + Chr(13)+Chr(10);
+ 'field 2 is ' + Transform(Evaluate(Field(2))))
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform