Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi select listbox
Message
From
02/08/2005 22:01:43
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Multi select listbox
Miscellaneous
Thread ID:
01038027
Message ID:
01038027
Views:
59
Hi

I am trying to set the selected items in a listbox upon entry to a form.

In the Init event I have the following
DODEFAULT()
this.AddProperty('cWotypes')
WITH this
	.cWotypes = oIni.profilestring('WotsCont', 'User', 'Wotypes','')	&& load from ini
	.cWotypes = IIF(EMPTY(.cWotypes), "[]",.cWotypes)

	m.cWotypes = .cWotypes
	FOR m.nCnt = 1 TO .ListCount
		.Selected(m.nCnt) = INLIST(.List(m.nCnt,2), &cWotypes)
	ENDFOR
	.Refresh()
ENDWITH
This is setting the values fine but my listbox does not have any items highlighted when the form displays.

I tried putting reload code in GotFocus but it only hightlighted it if I put NODEFAULT at the end without a DODEFAULT() at the beginning. Unfortunately this disables my control.

What am I doing wrong.

Regards
Geoff Scott
May all your weeds be wildflowers
Next
Reply
Map
View

Click here to load this message in the networking platform