Article ID: 138602
Article Last Modified on 2/11/2000
*-- Instantiate a form based on custom form class, TestForm.
frmMyForm = CREATEOBJECT("TestForm")
frmMyForm.show
READ EVENTS
*-- Define a custom class based on the FORM baseclass.
DEFINE CLASS TestForm AS FORM
CAPTION = "List Test"
AUTOCENTER = .T.
HEIGHT = 190
WIDTH = 300
*-- Add list box to the form.
ADD OBJECT List1 AS LISTBOX ;
WITH ;
TOP = 24, ;
LEFT = 24, ;
HEIGHT = 110, ;
WIDTH = 130, ;
CAPTION = "Next"
*-- Add command button to exit the program (form).
ADD OBJECT cmdQuit AS COMMANDBUTTON ;
WITH ;
TOP = 60, ;
LEFT = 180, ;
HEIGHT = 29, ;
WIDTH = 100, ;
CAPTION = "Quit"
*-- Add custom code to the Init event of the form.
PROCEDURE Init
THIS.LIST1.AddItem('One')
THIS.LIST1.AddItem('Two')
THIS.LIST1.AddItem('Three')
THIS.LIST1.AddItem('Four')
THIS.LIST1.AddItem('Five')
THIS.LIST1.AddItem('Six')
ENDPROC
*-- Add custom code to the Click event of cmdQuit.
PROCEDURE cmdQuit.click
THISFORM.Release
CLEAR EVENTS
ENDPROC
ENDDEFINE
*-- End custom class definition.
*-- End program.
Run this program. With the current Height property of the list box set to
110, there is not enough room in the list box to display the entire
contents of the list box. Therefore, when you scroll down to the last item
in the list box, the highlight bar stops on the last item.
Additional query words: VFoxWin
Keywords: KB138602