SRL Archive - Help and Support

Quick Form Question


Town

2007-04-22 15:23:35

I have a script using 2 forms. A main form and a seperate form that opens on a button click. I want to make a button on my second form that closes that form and saves the information in it on the click. That way only the main form is open.

The button:

CloseOther := TButton.Create(OtherForm);
CloseOther.Parent := OtherForm;
CloseOther.Left := 177;
CloseOther.Top := 180;
CloseOther.Width := 75;
CloseOther.Height := 25;
CloseOther.Hint := 'Click to Close and Save Other Form';
CloseOther.Caption := 'Close And Save Form';
CloseOther.ParentShowHint := False;
CloseOther.ShowHint := True;
CloseOther.TabOrder := 15;
CloseOther.OnClick := @Clicked;

Clicked Procedure:

CloseOther:
begin
SaveNewSettings;
// This is where the close would go
end;

Thanks alot :)