hola, tengo problemas para ejecutar un programa, cuando lo quiero correr me sale este mensaje de error:
project proyecto1.exe raised exception class EInvalid Operation with message 'cannot focus a disabled or invisible window'. Process stopped.
El codigo del programa es este:
Código Delphi
[-]
unit programita1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
ListBox1: TListBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
public
end;
type
TApunt=^TNodo;
TNodo=record
Info: String;
Liga: TApunt;
end;
var
Form1: TForm1;
Inicio,Fin: TApunt;
implementation
{$R *.dfm}
procedure Agregar(Elem: String);
Var Aux: TApunt;
begin
Inicio:=Nil;
New(Aux);
Aux^.Liga:=Nil;
Aux^.Info:=Elem;
if Inicio=Nil then Inicio:=Aux
else Fin^.Liga:=Aux;
Fin:=Aux;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Edit1.Text<>' ' then
begin
Agregar(Edit1.Text);
ListBox1.Items.Add(Edit1.Text);
Edit1.Clear;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ListBox1.Clear;
Edit1.Clear;
Edit1.SetFocus;
end;
end.
No sé cual es el problema, me gustaria que me ayudaran
Muchas gracias