Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying multiselects in listbox after returning to pa
Message
De
10/06/2002 12:15:38
 
 
À
04/06/2002 17:23:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00664721
Message ID:
00666577
Vues:
23
I have not seen difference whether the listbox is in or out of a pageframe. Check this and compare it to your code (Double click of the form is supposed to select items 2 and 3):
DEFINE CLASS form1 AS form


	Top = 0
	Left = 0
	Height = 272
	Width = 374
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT pageframe1 AS pageframe WITH ;
		ErasePage = .T., ;
		PageCount = 2, ;
		Top = 24, ;
		Left = 24, ;
		Width = 324, ;
		Height = 192, ;
		Name = "Pageframe1", ;
		Page1.Caption = "Page1", ;
		Page1.Name = "Page1", ;
		Page2.Caption = "Page2", ;
		Page2.Name = "Page2"


	ADD OBJECT form1.pageframe1.page2.list1 AS listbox WITH ;
		Height = 144, ;
		Left = 11, ;
		MultiSelect = .T., ;
		Top = 8, ;
		Width = 300, ;
		Name = "List1"

	PROCEDURE DblClick
		ThisForm.pageframe1.page2.list1.Selected(2)=.t.
		ThisForm.pageframe1.page2.list1.Selected(3)=.t.
	ENDPROC

	PROCEDURE list1.Init
		This.AddItem('test', 1)
		This.AddItem('test2', 2)
		This.AddItem('test3', 3)
		This.AddItem('test4', 4)
		This.AddItem('test5', 5)
		This.AddItem('test6', 6)
		This.AddItem('test7', 7)
		This.AddItem('test8', 8)
	ENDPROC
ENDDEFINE
HTH

>OK, that got me thinking in the right direction.
>
>Now my question is, how do I programmatically (sp?) select items in a listbox.
>
>how would I set the value of
>thisform.pf1.pg1.listbox1.selected[ncount]
>to .t. or .f. ?
>
>
>>>I have a multiselect listbox on a page of pageframe.
>>>
>>>All works well, but if I leave and return to the page, the display of which items were selected is cleared. How can I redisplay the 'selected' items on returning to the page?
>>
>>I was not able to reproduce this on my VFP 7.0 SP1/W2K Pro. How do you populate the rowsource of your Listbox? What kind of RowSourceType do you use? If you use tables/views, do you use table buffering?
>>
>>Regards
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform