Hola Paulao.
Acabo de hacer una prueba muy simplificada con un form, un frame y cuatro buttons y funciona correctamente. Por lo que el problema, como te dije antes, no está en el procedimiento ni en su llamado.
Te pongo el código y quizá te oriente para solucionarlo.
Form1:
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation {$R *.dfm}
uses Unit2;
procedure TForm1.FormCreate(Sender: TObject);
begin
with TFrame2.Create(Self) do
Parent:= Self;
end;
end.
Frame:
Código Delphi
[-]
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TFrame2 = class(TFrame)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure Button4Click(Sender: TObject);
private
public
procedure ButtonsOnOff;
end;
implementation {$R *.dfm}
procedure TFrame2.ButtonsOnOff;
begin
Button1.Enabled:= not Button1.Enabled;
Button2.Enabled:= not Button2.Enabled;
Button3.Enabled:= not Button3.Enabled;
end;
procedure TFrame2.Button4Click(Sender: TObject);
begin
ButtonsOnOff;
end;
end.
Saludos.