Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help.....newbie in the house
Message
From
18/07/2001 20:25:07
 
 
To
18/07/2001 19:37:01
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00532314
Message ID:
00532326
Views:
23
>this should be fairly painless....
>
>asked to have a picture of client next to info on lead screen....
>how do I add a picture of say myself for record number 1, and then a picture of you
>for record number 2 ....without having my image pop up on rec2

You can do it two ways. 1) Add the picture to a general field. (I don't ever do it this way. General fields tend to make the memo file very big fast...always a recipe for data corruption. 2) Add a character field that's used to store the path to a picture stored on disk.

Here is a runnable example of #2 that you can paste into a prg called TEMP.PRG.
CREATE TABLE MyPics ( MyName C(25), MyPic C(254) )
INSERT INTO MyPics (MyName, MyPic) VALUES ("GoodNancy", HOME() + 'GRAPHICS\BITMAPS\ASSORTED\BEANY.BMP' )
INSERT INTO MyPics (MyName, MyPic) VALUES ("BadNancy", HOME() + 'GRAPHICS\BITMAPS\ASSORTED\SMOKES.BMP' )

LOCAL ox
ox = NEWOBJECT('frmMyPics', 'temp.PRG')
ox.SHOW(1)

RETURN

DEFINE CLASS frmMyPics AS FORM
	ADD OBJECT btnNext AS COMMANDBUTTON WITH ;
		CAPTION = "Next Pic", ;
		height = 24

	ADD OBJECT imgMyPic AS IMAGE WITH ;
		TOP = 25, ;
		HEIGHT = 80, ;
		WIDTH = 80

	PROCEDURE INIT
		GO TOP IN MyPics
		THIS.imgMyPic.PICTURE = MyPics.MyPic
	ENDPROC

	PROCEDURE btnNext.CLICK
		SKIP 1 IN MyPics
		IF EOF( 'MyPics' )
			GO TOP IN MyPics
		ENDIF
		THISFORM.imgMyPic.PICTURE = MyPics.MyPic
		THISFORM.REFRESH()
	ENDPROC
ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform