12345678910111213141516171819202122232425262728293031323334353637 |
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
- type
- TForm1 = class(TForm)
- lst1: TListBox;
- btn1: TButton;
- procedure btn1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- { Realiza la acción del botón. }
- procedure TForm1.btn1Click(Sender: TObject);
- begin
- if lst1.ItemIndex >= 0 then
- begin
- Caption := lst1.Items[lst1.ItemIndex];
- end;
- end;
- end.
|