I've got a form with a bunch of RadioGroups. I created an array of 
RadioGroups to make it easier to write code to work with the group. I've 
also got a ComboBox in which the user can choose whether s/he would like to 
display 2, 3, or 4 items (i.e., select "2" and all the RadioGroups will have 
2 and 1 as their items; select "3" and they'll all display 3, 2, and 1).

The ComboBox OnChange event begins by clearing all the RadioGroups, and then 
adding items back (with the items added depending upon what the user 
selected in the ComboBox):

for i := 1 to 19 do
  begin
    gRadioArray[i].Items.Clear;
    with cbxPerformanceLevels do
      //add items here, depending on what user selected
  end;

The code works fine, and it's simple. The problem is that it's slow. On my 
machine I can watch each RadioGroup be cleared, one at a time, before items 
are added in.

Do you have any ideas about a faster way to do this?

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to