SRL Archive - Help and Support

Need help with FORM!


Claymore

2010-09-30 21:05:51

Ok i need help with Tabs. If anyone is willing to show me a script that uses tabs on their forms, that would work just as fine.

I looked everywhere in the Tutorial and all i can find is a small segment on how to use Tabs and it didnt quite make sense.

I cant seem to find a recent script that support tabs on their forms.

Thanks.

Dgby714

2010-09-30 21:22:38

Example:
program TabsExample;
var
Form: TForm;
PageControl: TPageControl;
TabSheet: array[1..5] of TTabSheet;
Labels: array[1..5] of TLabel;

procedure ShowForm;
var
I: integer;
begin;
Form := TForm.Create(nil);
PageControl := TPageControl.Create(Form);
for I := 1 to 5 do
begin
TabSheet[I] := TTabSheet.Create(PageControl);
Labels[I] := TLabel.Create(TabSheet[I]);
end;

Form.Width := 250;
Form.Height := 250;
PageControl.Parent := Form;
PageControl.Width := 250;
PageControl.Height := 250;
PageControl.Caption := 'PageControl';

for I := 1 to 5 do
begin
TabSheet[I].Parent := PageControl;
TabSheet[I].Caption := 'Tab ' + IntToStr(I);
TabSheet[I].PageControl := PageControl;
Labels[I].Parent := TabSheet[I];
Labels[I].Caption := 'This is Tab ' + IntToStr(I);
Labels[I].Left := 100;
Labels[I].Top := 100;
end;

Form.ShowModal;

for I := 5 downto 1 do
begin
Labels[I].Free;
TabSheet[I].Free;
end;
PageControl.Free;
Form.Free;
end;

var
V: TVariantArray;

begin
ThreadSafeCall('ShowForm', V);
end.

Claymore

2010-09-30 23:35:54

Oh my Jizzle! Thanks so much + Rep and love <3 No homo.

By the way, where did you find TPageControl and TTabSheet in SCAR's Form editor? All i could find was TTabControl which did nothing >>

Dgby714

2010-10-01 01:31:24

I didnt use scar lol