Как сделать плавное переключение между вкладками в TTabControl?
// Способ первый
procedure TForm1.Button1Click(Sender: TObject);
begin
TabControl1.SetActiveTabWithTransition(TabItem2, TTabTransition.Slide{, TTabTransitionDirection.Normal});
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
TabControl1.SetActiveTabWithTransition(TabItem1, TTabTransition.Slide, TTabTransitionDirection.Reversed);
end;
// Способ второй
procedure TForm1.Button1Click(Sender: TObject);
begin
TabControl1.GotoVisibleTab(TabItem2.Index{, TTabTransition.Slide, TTabTransitionDirection.Normal});
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
TabControl1.GotoVisibleTab(TabItem1.Index, TTabTransition.Slide, TTabTransitionDirection.Reversed);
end;
// Способ третий
procedure TForm1.Button1Click(Sender: TObject);
begin
TabControl1.Next(TTabTransition.Slide{, TTabTransitionDirection.Normal});
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
TabControl1.Previous(TTabTransition.Slide, TTabTransitionDirection.Reversed);
end;
|