Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing Nav buttons (in a class) from a listbox
Message
From
07/02/2002 17:25:49
 
 
To
07/02/2002 15:30:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00616960
Message ID:
00617060
Views:
23
>I have a form with among other items a list box and a set of navigation buttons for items in the list. If I use the navigation buttons to move in the list box they get refreshed, i.e when on (assume 3 lines) line
>
> 1 - only down bottom buttons are highlighted
> 2 - all buttons are highlighted
> 3 - only up and top button are highlighted.
>
>This is controled by code in the refresh method of the class by setting some flags, i.e. topfile, endfile. Can I do this from the interactive change method of the listbox (where form refresh is called) and if so how.
>
>TIA

TOP BUTTON
THISFORM.Erase(THISFORM.lst1)
THISFORM.lst1.Selected(1) = .T.
BOTTOM BUTTON
THISFORM.Erase(THISFORM.lst1)
THISFORM.lst1.Selected(THISFORM.lst1.ListCount) = .T.
UP BUTTON
LOCAL lnPos
lnPos = THISFORM.Erase(THISFORM.lst1)
IF lnPos = 1 THEN
	THISFORM.lst1.Selected(1) = .T.
ELSE
	THISFORM.lst1.Selected(lnPos - 1) = .T.
ENDIF
DOWN BUTTON
LOCAL lnPos
lnPos = THISFORM.Erase(THISFORM.lst1)
IF lnPos = THISFORM.lst1.ListCount THEN
	THISFORM.lst1.Selected(THISFORM.lst1.ListCount) = .T.
ELSE
	THISFORM.lst1.Selected(lnPos + 1) = .T.
ENDIF
ERASE
FUNCTION ERASE
LPARAMETERS oList
LOCAL i
	FOR i = 1 TO oList.ListCount
		IF oList.Selected(i) THEN
			oList.Selected(i) = .F.
			RETURN i
		ENDIF
	ENDFOR
ENDFUNC
Assumptions:

- MultiSelect is set to .F.
- ListBox is named lst1

You don't need anything else...

Stephane.
Previous
Reply
Map
View

Click here to load this message in the networking platform