ListFrame.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit ListFrame;
- interface
- uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ToolWin, ComCtrls, StdCtrls, ExtCtrls;
- type
- TFrameList = class(TFrame)
- ListBox: TListBox;
- Edit: TEdit;
- btnAdd: TButton;
- btnRemove: TButton;
- btnClear: TButton;
- Bevel: TBevel;
- procedure btnAddClick(Sender: TObject);
- procedure btnRemoveClick(Sender: TObject);
- procedure btnClearClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- implementation
- {$R *.DFM}
- procedure TFrameList.btnAddClick(Sender: TObject);
- begin
- ListBox.Items.Add (Edit.Text);
- end;
- procedure TFrameList.btnRemoveClick(Sender: TObject);
- begin
- if ListBox.ItemIndex >= 0 then
- ListBox.Items.Delete (ListBox.ItemIndex);
- end;
- procedure TFrameList.btnClearClick(Sender: TObject);
- begin
- ListBox.Clear;
- end;
- end.