Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ico's/small JPG's in a listbox
Message
 
To
15/03/2010 18:21:26
Luis Navas
Independent Consultant
Auckland, New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01454679
Message ID:
01454695
Views:
55
>No, I think you are also right, I believe pictures can only be added if the rowsource type is 1 and he was asking "depending on the record status", but I'm not sure.

I also think you are also right :)

The workaround, I guess, is to manually populate the listbox
LOCAL loForm

loForm		= NEWOBJECT("form1")
loForm.Show(1)
RETURN

DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT list1 AS listbox WITH ;
		Anchor = 15, ;
		ColumnWidths = "100", ;
		Height = 228, ;
		Left = 12, ;
		Top = 12, ;
		Width = 349, ;
		Name = "List1"


	PROCEDURE Load
		CREATE CURSOR C_Countries (PK I AutoInc, Name C(20), MAP C(120))

		INSERT INTO C_Countries ( Name, Map ) VALUES ('France', HOME(4) + 'Icons\Flags\CTRFRAN.ICO')
		INSERT INTO C_Countries ( Name, Map ) VALUES ('Canada', HOME(4) + 'Icons\Flags\CTRCAN.ICO')
		INSERT INTO C_Countries ( Name, Map ) VALUES ('Germany', HOME(4) + 'Icons\Flags\CTRGERM.ICO')
		INSERT INTO C_Countries ( Name, Map ) VALUES ('Italy', HOME(4) + 'Icons\Flags\CTRITALY.ICO')
		INSERT INTO C_Countries ( Name, Map ) VALUES ('Japan', HOME(4) + 'Icons\Flags\CTRJAPAN.ICO')
		INSERT INTO C_Countries ( Name, Map ) VALUES ('Mexico', HOME(4) + 'Icons\Flags\CTRMEX.ICO')
		INSERT INTO C_Countries ( Name, Map ) VALUES ('Spain', HOME(4) + 'Icons\Flags\CTRSPAIN.ICO')
		
		INDEX on Name TAG Name
	ENDPROC


	PROCEDURE list1.Init
		LOCAL lnItem

		SELECT C_Countries
		lnItem = 0
		SCAN
			lnItem = lnItem + 1 
			this.AddListItem(ALLTRIM(C_Countries.Name), C_Countries.PK)
			this.Picture(lnItem) = ALLTRIM(C_Countries.Map)
		ENDSCAN
	ENDPROC


ENDDEFINE
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform