Recent

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

coradi

  • Full Member
  • ***
  • Posts: 148
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. 
Amstrad Schneider CPC 6128
AVR8/ARM(STM32)

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • 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

 

TinyPortal © 2005-2018