AnchForm.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit AnchForm;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
- type
- TForm1 = class(TForm)
- BtnClose: TButton;
- BtnShow: TButton;
- ListBox1: TListBox;
- procedure BtnShowClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure BtnCloseClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.DFM}
- procedure TForm1.BtnShowClick(Sender: TObject);
- begin
- ShowMessage (ListBox1.Items [ListBox1.ItemIndex]);
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- // select the first item
- ListBox1.ItemIndex := 0;
- end;
- procedure TForm1.BtnCloseClick(Sender: TObject);
- begin
- Close;
- end;
- end.