你可以用以下代码测试各种事件的出发时机
==========================
unit MainForm;
interface
uses
Business.System, Business.Forms, Business.Data, Business.Model;
type
TMainForm = class(TForm)
DataSetBZSJJ1: TSQLDataSet;
DataEdit1: TDataEdit;
DataSource1: TDataSource;
DataEdit2: TDataEdit;
DataEdit3: TDataEdit;
DataEdit4: TDataEdit;
Button1: TButton;
Button2: TButton;
DataGrid1: TDataGrid;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure BizFormActivate(Sender: TObject);
procedure BizFormCanResize(Sender: TObject; var NewWidth, NewHeight: Integer; var Resize: Boolean);
procedure BizFormClick(Sender: TObject);
procedure BizFormClose(Sender: TObject; var Action: TCloseAction);
procedure BizFormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure BizFormConstrainedResize(Sender: TObject; var MinWidth, MinHeight, MaxWidth, MaxHeight: Integer);
procedure BizFormContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
procedure BizFormCreate(Sender: TObject);
procedure BizFormDblClick(Sender: TObject);
procedure BizFormDeactivate(Sender: TObject);
procedure BizFormDestroy(Sender: TObject);
procedure BizFormDockDrop(Sender: TObject; Source: TDragDockObject; X, Y: Integer);
procedure BizFormDockOver(Sender: TObject; Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
procedure BizFormDragDrop(Sender, Source: TObject; X, Y: Integer);
procedure BizFormDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
procedure BizFormEndDock(Sender, Target: TObject; X, Y: Integer);
procedure BizFormGetSiteInfo(Sender: TObject; DockClient: TControl; var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean);
function BizFormHelp(Command: Word; Data: Integer; var CallHelp: Boolean): Boolean;
procedure BizFormHide(Sender: TObject);
procedure BizFormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure BizFormKeyPress(Sender: TObject; var Key: Char);
procedure BizFormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure BizFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure BizFormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure BizFormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure BizFormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure BizFormMouseWheelDown(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
procedure BizFormMouseWheelUp(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
procedure BizFormPaint(Sender: TObject);
procedure BizFormResize(Sender: TObject);
// procedure BizFormShortCut(var Msg: TWMKey; var Handled: Boolean);
procedure BizFormShow(Sender: TObject);
procedure BizFormStartDock(Sender: TObject; var DragObject: TDragDockObject);
procedure BizFormUnDock(Sender: TObject; Client: TControl; NewTarget: TWinControl; var Allow: Boolean);
private
{private declarations}
public
{public declarations}
end;
implementation
procedure TMainForm.Button1Click(Sender: TObject);
begin
DataSetBZSJJ1.RefreshRecord;
end;
procedure TMainForm.Button2Click(Sender: TObject);
begin
DataSetBZSJJ1.Open;
end;
procedure TMainForm.BizFormActivate(Sender: TObject);
begin
Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormCanResize(Sender: TObject; var NewWidth, NewHeight: Integer; var Resize: Boolean);
begin
Dialogs.Showmessage('OnCanResize');
end;
procedure TMainForm.BizFormClick(Sender: TObject);
begin
Dialogs.Showmessage('OnClick');
end;
procedure TMainForm.BizFormClose(Sender: TObject; var Action: TCloseAction);
begin
Dialogs.Showmessage('OnClose');
end;
procedure TMainForm.BizFormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
Dialogs.Showmessage('OnCloseQuery');
end;
procedure TMainForm.BizFormConstrainedResize(Sender: TObject; var MinWidth, MinHeight, MaxWidth, MaxHeight: Integer);
begin
Dialogs.Showmessage('OnConstrainedResize');
end;
procedure TMainForm.BizFormContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormCreate(Sender: TObject);
begin
Dialogs.Showmessage('OnCreate');
end;
procedure TMainForm.BizFormDblClick(Sender: TObject);
begin
Dialogs.Showmessage('OnDblClick');
end;
procedure TMainForm.BizFormDeactivate(Sender: TObject);
begin
Dialogs.Showmessage('OnDeactivate');
end;
procedure TMainForm.BizFormDestroy(Sender: TObject);
begin
Dialogs.Showmessage('OnDestroy');
end;
procedure TMainForm.BizFormDockDrop(Sender: TObject; Source: TDragDockObject; X, Y: Integer);
begin
Dialogs.Showmessage('OnDockDrop');
end;
procedure TMainForm.BizFormDockOver(Sender: TObject; Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
Dialogs.Showmessage('OnDockOver');
end;
procedure TMainForm.BizFormDragDrop(Sender, Source: TObject; X, Y: Integer);
begin
Dialogs.Showmessage('OnDragDrop');
end;
procedure TMainForm.BizFormDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
Dialogs.Showmessage('OnDragOver');
end;
procedure TMainForm.BizFormEndDock(Sender, Target: TObject; X, Y: Integer);
begin
Dialogs.Showmessage('OnEndDock');
end;
procedure TMainForm.BizFormGetSiteInfo(Sender: TObject; DockClient: TControl; var InfluenceRect: TRect; MousePos: TPoint; var CanDock: Boolean);
begin
Dialogs.Showmessage('OnGetSiteInfo');
end;
function TMainForm.BizFormHelp(Command: Word; Data: Integer; var CallHelp: Boolean): Boolean;
begin
Dialogs.Showmessage('OnHelp');
end;
procedure TMainForm.BizFormHide(Sender: TObject);
begin
Dialogs.Showmessage('OnHide');
end;
procedure TMainForm.BizFormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormKeyPress(Sender: TObject; var Key: Char);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormMouseWheelDown(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormMouseWheelUp(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormPaint(Sender: TObject);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormResize(Sender: TObject);
begin
Dialogs.Showmessage('OnResize');
end;
{procedure TMainForm.BizFormShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
Dialogs.Showmessage('OnShortCut');
end;
}
procedure TMainForm.BizFormShow(Sender: TObject);
begin
Dialogs.Showmessage('OnShow');
end;
procedure TMainForm.BizFormStartDock(Sender: TObject; var DragObject: TDragDockObject);
begin
// Dialogs.Showmessage('OnActivate');
end;
procedure TMainForm.BizFormUnDock(Sender: TObject; Client: TControl; NewTarget: TWinControl; var Allow: Boolean);
begin
// Dialogs.Showmessage('OnActivate');
end;
end. |