Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very large numbers of pictures in VFP combos?
Message
From
26/10/2016 14:57:16
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
20/10/2016 05:42:45
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01642137
Message ID:
01642378
Views:
92
Daniel,

If you use a grid, traditionally you'd need an image column containing all the image controls you need, using dynamiccurrentcontrol code to change the current control per row. If there are lots of potential images then you need to include them all and the grid can get very sluggish.

However, using a VFP trick you can show any image you like in a grid, without including it as a separate column control.

1) You're not limited to one changing image per column. Drop as many image controls as you want to show at once into a container, then include the container in your image column.
2) E.g. if each row needs to show images for pdf status, printed status and emailed status, create a container with a row of 3 images and include that in your image column. Works the same whether you need 1 image or a row of 5 images per record.
E.g. you could have mycontainer.imgPDF, mycontainer.imgPrint and mycontainer.imgEmail images side by side in a wide container, as currentcontrol in a column wide enough to show the whole container with its images.
3) To change the .picture properties per row: check out the backstyle_access method/event. Pretty simple: set the image.picture properties in the backstyle_access method and it'll update per row.

E.g.
* Change pictures according to document status
This.imgPdf.Picture = icase( vDoc.pdfstat='Y', 'bitmaps/docstatus_pdfdone.png',vDoc.pdfstat='E', 'bitmaps/docstatus_pdferr.png','bitmaps/docstatus_pdftodo.png')
This.imgPrint.Picture = 'bitmaps/docstatus_'+trim(vDoc.ds_print)+'.png'
This.imgEmail.Picture = 'bitmaps/docstatus_'+trim(vDoc.ds_email)+'.png'
Return This.backstyle
Simple as that! Now you can show one or more images per row with infinite variability, without having to load all the images into separate columns with separate dynamiccurrentcontrol code. Just make sure the images are accessible/included in your project as usual and you're done.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform