Article ID: 162254
Article Last Modified on 5/12/2003
* Begin ColFocus.prg
CLEAR ALL
CLEAR
CLOSE ALL
USE HOME()+ "SAMPLES\DATA\EMPLOYEE" && In Visual FoxPro 6.0, locate
&& the employee table and adjust
&& the path accordingly.
*-- Create a form
MyForm=CREATEOBJECT("Form")
WITH MyForm
.AutoCenter= .T.
.WindowType=1 && Modal
.AddObject("Edit1", "EditBox")
WITH .Edit1
.Visible=.T.
.Height= 23
.Width= MyForm.Width
.Value="Column3.Container.GotFocus() never fires"
ENDWITH
*-- Add a Grid
.AddObject("Grid1", "Grid")
WITH .Grid1
.Top=40
.Visible= .T.
.ColumnCount=2
*-- Add a container to a column
.AddObject("Column3", "Column")
.Column3.RemoveObject("Text1")
.Column3.AddObject("Container1", "MyContainer")
.Column3.Visible= .T.
.Column3.Container1.Visible=.T.
ENDWITH
.SHOW()
ENDWITH
*-- GotFocus() and LostFocus() container
DEFINE CLASS MyContainer as Container
BackColor=RGB(255,0,0)
BackStyle=1
PROCEDURE GotFocus
ACTIVATE SCREEN
?" In GotFocus of Column 3"
ENDPROC
PROCEDURE LostFocus
ACTIVATE SCREEN
?"In LostFocus of Column 3 "
ENDPROC
ENDDEFINE
* End ColFocus.prg
Additional query words: kbvfp500 kbvfp600
Keywords: kbbug kbcode KB162254