>In VFP 6.0, if I have an object reference to a grid column, is there any property that can tell me which column I have? If the columns are movable, the ColumnOrder property is not useful (since it gives current position which changes when the user moves the column). I could use the column name, if necessary, but this solution is not ideal because it imposes a requirement on the naming of columns.
> Thanks, Chaim
Well, even for VFP5, (actually I haven't upgrade to 6.0)
there are some property to handle child objects...
For Example,
With This
For ix = 1 to .ColumnCount
.Columns[ix].RemoveObj("text1")
.Columns[ix].AddObject("Text1", "myTxt")
.Columns[ix].Text1.visible = .T.
.Columns[ix].Text1.fontsize = 12
.Columns[ix].Text1.fontname = "Arial"
EndFor
End With
Besides, there are some similar count and array property to do...
Forms[] ~~ FormCount -- Formset
Controls[] ~~ ControlCount -- Form, Container, Toolbar, Page, Column
Buttons[] ~~ ButtonCount -- OptionGroup, CommandGroup
Pages[] ~~ PageCount -- PageFrame
Columns[] ~~ ColumnCount -- Grid
So, you can make a Recursive Function to get all objects into a single simple array.... ^_~
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.