主要应用了:
1. 手动创建控件及释放;
2. 绑定控件事件;
代码如下:
unit uFormMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls;
const CalcCount = 5;
type
TFormMain = class(TForm)
edtExpression: TEdit;
pnlNum: TPanel;
btnClose: TButton;
pnlCalc: TPanel;
btnClear: TButton;
stat1: TStatusBar;
btnBackspace: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure btnNumClick(Sender: TObject);
procedure btnCalcClick(Sender: TObject);
procedure btnClearClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
procedure edtExpressionKeyPress(Sender: TObject; var Key: Char);
procedure btnBackspaceClick(Sender: TObject);
private
{ Private declarations }
public
btnNum: array[0..9] of TButton;
btnCalc