sólo te falta un begin... end porque dicho if tiene más de una instrucción dentro:
Código Delphi
[-]unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
SpeedButton1: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
nombre: Integer;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
nombre:= 123456;
if edit1.Text = inttostr(nombre) then
begin
Label1.Caption:= 'Contraseña correcta'
Application.CreateForm(TForm2,Form2)
Form2.Show
end
else
Label1.Caption:='contraseña incorrecta';
end;
end.
COmo hago para llamar un segundo formulario desde el formulario principal?[/quote]