Ver Mensaje Individual
  #2  
Antiguo 29-07-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 27
Caral Va por buen camino
Hola
A buen santo te arrimas, pero bueno, aqui esto lo que pienso:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure OnButton1Click(Sender: TObject);
    procedure OnButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  Button1,Button2: TButton;
  ScrollBox1: TScrollBox;
implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
    ScrollBox1 := TScrollBox.Create(Self);
    ScrollBox1.Parent := Self;
  with ScrollBox1 do
  begin
    Button1:= TButton.Create(ScrollBox1);
    Button1.Parent := ScrollBox1;
    Button1.Caption := 'Botón';
    Button1.Left:= 20;
    Button1.Top:= 10;
    Button1.OnClick := OnButton1Click;

    Button2:= TButton.Create(ScrollBox1);
    Button2.Parent := ScrollBox1;
    Button2.Caption := 'Botón';
    Button2.Left:= 100;
    Button2.Top:= 10;
    Button2.OnClick := OnButton2Click;
end;
end;

procedure TForm1.OnButton1Click(Sender: TObject);
begin
  ShowMessage('Presionaste el boton 1!');
end;

procedure TForm1.OnButton2Click(Sender: TObject);
begin
  ShowMessage('Presionaste el boton 2!');
end;

end.
Saludos
Responder Con Cita