Показать сообщение отдельно
  #4  
Старый 11.12.2010, 10:49
Аватар для BoRoV
BoRoV BoRoV вне форума
Начинающий
 
Регистрация: 08.09.2008
Сообщения: 193
Репутация: 12694
По умолчанию

Главное TabOrder'ы правильно выставь.
Код:
var
  Current: integer; // Глобальная переменая

...
procedure TForm1.Button_NextClick(Sender: TObject);
var
  i: integer;
begin
  for i := 0 to ComponentCount - 1 do
    if (Components[i] is TRadioButton) then
      if (Components[i] as TRadioButton).Tag > Current then
      begin
        (Components[i] as TRadioButton).Checked := true;
        Current := (Components[i] as TRadioButton).Tag;
        break;
      end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  i: integer;
begin
  Current := 0;
  for i := 0 to ComponentCount - 1 do
    if (Components[i] is TRadioButton) then
    begin
      (Components[i] as TRadioButton).Tag := Current;
      Inc(Current);
    end;
  Current := -1;
end;
Ответить с цитированием