Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi Select in Listbox
Message
From
21/04/1998 05:20:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00093412
Message ID:
00093598
Views:
35
>>>>Is it possible to have Multiple Items Selected in a Listbox?
>>>>
>>>>If so, how?
>>>>
>>>>Thanks
>>>>Jerimi
>>>>PS: I know one answer VFP.... :)
>>>
>>>
>>>YOu have to make your own.
>>I can't remember the syntax now but yes (In FP 2.x). I can send you an example by tomorrow if you want.
>>Cetin
>Yeah if you have an example, that would be great.
>I am using DEFINE POPUP with PROMPT and MULTISELECT does not work
>with the PROMPT command.
>I am using a SQL SELECT to gather into a cursor, then displaying in listbox.
>Any help is appreciated...
This is a basic example using as a listbox.
SET TALK OFF
DEFINE WINDOW mywindow ;
		FROM INT((SROW()-18)/2),INT((SCOL()-60)/2) ;
		TO INT((SROW()-18)/2)+17,INT((SCOL()-60)/2)+59 ;
		NOFLOAT ;
		NOCLOSE ;
		SHADOW ;
		NOMINIMIZE ;
		COLOR SCHEME 1

#REGION 1
select company ;
	from (home()+"tutorial\customer") ;
	into array popper
DEFINE POPUP popstop ;
	SCROLL MULTI MARGIN ;
	from 2,0 to 14,20 ;
	in window mywindow ;
	mark chr(16)
FOR IXP=1 TO ALEN(popper,1)
    DEFINE BAR IXP OF popstop PROMPT popper[IXP]
ENDFOR
activate popup popstop nowait

#REGION 1
IF WVISIBLE("mywindow")
	ACTIVATE WINDOW mywindow SAME
ELSE
	ACTIVATE WINDOW mywindow NOSHOW
ENDIF
@ 2,29 GET m.showthem ;
	PICTURE "@*HN Selected" ;
	SIZE 1,8,1 ;
	DEFAULT 1 ;
	VALID _ru50odwhc()
@ 1,2 GET m.activator ;
	PICTURE "@*HN Pop List" ;
	SIZE 1,9,1 ;
	DEFAULT 1 ;
	VALID _ru50odwhr()
@ 4,28 GET m.testtextbox ;
	SIZE 1,10 ;
	DEFAULT " "

IF NOT WVISIBLE("mywindow")
	ACTIVATE WINDOW mywindow
ENDIF
READ CYCLE
RELEASE WINDOW mywindow

FUNCTION _ru50odwhc     &&  m.showthem VALID
#REGION 1
activate screen
FOR KP=1 TO ALEN(popper,1)
   IF MRKBAR("POPSTOP",KP)
	* Item selected
	? prmbar("POPSTOP",KP)
   ENDIF
ENDFOR

FUNCTION _ru50odwhr     &&  m.activator VALID
#REGION 1
activate popup popstop
I prefer "popup on demand" because it's space saving and multiselect list has little meaning to show all time. For it you would only need the m.activator to show and m.showthem routine to collect selected.
Hope it helps.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform