pker overkil
Forum Addict
Ive tried to learn how to make forms and ive probably posted this 20 times but can someone tell me a detailed tutorial that covers how to make forms and use them in your script?
var
frmDesign: TForm;
Label1: TLabel;
WebsiteURL: TEdit;
Button1: TButton;
CheckBox1, CheckBox2: TCheckBox;
procedure TypeURL(Sender: TObject);
begin
OpenWebPage('http://' + WebsiteURL.text);
end;
procedure ClearURLBox(Sender: TObject);
begin
if(WebsiteURL.text = 'WebsiteURL <example: www.google.com> (do not include "http://" part)')then
WebsiteURL.text:= '';
end;
procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 268;
frmDesign.Top := 114;
frmDesign.Width := 386;
frmDesign.Height := 190;
frmDesign.Caption := 'Websiter 3000';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.Windowstate := wsMinimized
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 51;
Label1.Top := 36;
Label1.Width := 147;
Label1.Height := 13;
Label1.Caption := 'What Website you want to visit';
WebsiteURL := TEdit.Create(frmDesign);
WebsiteURL.Parent := frmDesign;
WebsiteURL.Left := 209;
WebsiteURL.Top := 32;
WebsiteURL.Width := 152;
WebsiteURL.Height := 21;
WebsiteURL.TabOrder := 8;
WebsiteURL.Text:= 'WebsiteURL <example: www.google.com> (do not include "http://" part)';
WebsiteURL.OnClick:= @ClearURLBox;
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 187;
Button1.Top := 91;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Go!';
Button1.TabOrder := 9;
Button1.Onclick := @TypeUrl;
CheckBox1 := TCheckBox.Create(frmDesign);
CheckBox1.Parent := frmDesign;
CheckBox1.Left := 52;
CheckBox1.Top := 104;
CheckBox1.Width := 97;
CheckBox1.Height := 17;
CheckBox1.Caption := 'Internet Explorer';
CheckBox1.TabOrder := 10;
CheckBox2 := TCheckBox.Create(frmDesign);
CheckBox2.Parent := frmDesign;
CheckBox2.Left := 52;
CheckBox2.Top := 76;
CheckBox2.Width := 97;
CheckBox2.Height := 17;
CheckBox2.Caption := 'Mozilla Firefox';
CheckBox2.TabOrder := 11;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('InitForm', v);
end;
Procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
FreeForm(frmDesign);
end.

