Jud 1 Posted June 22 (edited) Never mind, I remembered how to do it: with TabSheet6.controls[ i] as tRadioGroup do ItemIndex := LandData[ index].LandWhoTo; ============================================== original: I can set properties like top and left in a loop, but not other properties of a control. Two examples below. Is there a way to set these properties in a loop? for i := 0 to TabSheet6.ControlCount - 1 do if TabSheet6.controls[ i] is TEdit then begin inc( index); TabSheet6.controls[ i].text := LandData[ index].LandName; // protected end; .// for, if for i := 0 to TabSheet6.ControlCount - 1 do if TabSheet6.controls[ i] is TRadioGroup then begin inc( index); TabSheet6.controls[ i].top := 14 + 32 * index; TabSheet6.controls[ i].ItemIndex := LandData[ index].LandWhoTo; // undeclared identifier end; // for, if Edited June 22 by Jud Share this post Link to post
Jud 1 Posted June 22 (edited) By googling, I think I found out how to do it; tRadioGroup( TabSheet1.controls[ i]).ItemIndex := LandData[ index].LandWhoTo; ========================= original: Well, this still says that ItemIndex is protected: with TabSheet6.controls[ i] as tEdit do TabSheet6.controls[ i].text := LandData[ index].LandName; // protected Can it be set in a loop? Edited June 23 by Jud Share this post Link to post