Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I assign an image's picture value from a table?
Message
From
21/11/2006 13:49:31
 
 
To
21/11/2006 11:07:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01171337
Message ID:
01171527
Views:
6
>>>I'm using VFP 6.0. I have a table that stores a key and the location of the picture.
>>
>>You can add this code to the form's refresh
>>if !empty(yourtable.yourfield)
>>  image1.picture=youtable.yourfield
>>  image1.visible=.T.
>>else
>>  image1.visible=.F.
>>endif
>
>I've added a method called (surprised?) "refresh" to the image object itself, and guess what - it gets called on every refresh of the parent. So this code could as well go there, with "image." replaced with "this.".

Personally I usually use a timer to refresh the image, so that if my users navigates in a table, the image is not refreshed during the navigation, but about 0.25s after the navigation is stopped. This prevents flicker and reduces the network traffic. I have created a subclass for this purpose.
Previous
Reply
Map
View

Click here to load this message in the networking platform