Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting a row in a Filtered List Box
Message
 
 
To
02/10/2004 18:45:37
Mike Smith
Doncaster Office Services
Oakville, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00948266
Message ID:
00948270
Views:
21
Hi Mike,

It looks like you're trying to get LisyBox behave as a grid. Wouldn't be easier to use grid instead? For example,
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form


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

	ADD OBJECT grid1 AS grid WITH ;
		ColumnCount = 1, ;
		DeleteMark = .F., ;
		HeaderHeight = 0, ;
		Height = 204, ;
		Left = 12, ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "products", ;
		ScrollBars = 2, ;
		SplitBar = .F., ;
		Top = 24, ;
		Width = 348, ;
		AllowCellSelection = .F., ;
		Name = "Grid1", ;
		Column1.ControlSource = "products.eng_name", ;
		Column1.Width = 319, ;
		Column1.Name = "Column1"

	PROCEDURE Load
		CLOSE DATABASES 
		OPEN DATABASE (HOME(2) + "\data\testdata.DBC")
		USE testdata!products
	ENDPROC
ENDDEFINE
>I find in VFP 6.0 and VFP 8.0 that it is difficult to get a particular row to highlight coming into a filtered list box. My work around is to create a field called COUNT1 and put the list index values into COUNT1 for the current filter and order. So suppose I want to have the cursor highlight at recno() = m.r1, I then put into the Init LOCATE FOR RECNO() = m.R1 then THISFORM.LIST1.LISTINDEX = COUNT1.
>
>Now if the user wants to change the List Order to one of 4 ways, then this process gets more complicated.
>
>What I think would be better, is if we could just say in the Init, LOCATE FOR RECNO() = M.R1 and have the curser highlight at that row.
>
>I don't want to submit this to the Wish List if this has been already solved in VFP 9.0 beta. So if any of the users could comment on this, it would help me with my next step.
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform