* * *

Author Topic: Where to place to run on start?  (Read 461 times)

coradi

  • New member
  • *
  • Posts: 45
Where to place to run on start?
« on: June 28, 2018, 11:49:50 am »
Hallo,
where I have to put this line
  Label1.Caption:='Test';

If I want to run it, at programmstart?
Without clicking a Button or other things

Code: [Select]
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Label1Click(Sender: TObject);
  private

  public

  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Label1Click(Sender: TObject);
begin

end;

procedure TForm1.Button1Click(Sender: TObject);
begin

end;

end. 

Bart

  • Hero Member
  • *****
  • Posts: 3127
    • Bart en Mariska's Webstek
Re: Where to place to run on start?
« Reply #1 on: June 28, 2018, 12:07:19 pm »
Set the caption in the ObjectInspetor.
Alternatively use OnCreate event of Form1 and set Caption there.

Bart

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus