Ну а такое зачудить, что мешает:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Mask, ComCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
public
end;
TMyPanel = class(TCustomPanel)
protected
procedure WMGetDlgCode(var Msg: TMessage); message WM_GETDLGCODE;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
procedure KeyPress(var Key: Char); override;
function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;
end;
var
Form1: TForm1;
MyPanel: TMyPanel;
implementation
procedure TForm1.FormCreate(Sender: TObject);
begin
MyPanel := TMyPanel.Create(Self);
MyPanel.Parent := Self;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
MyPanel.SetFocus;
end;
procedure TMainPanel.WMGetDlgCode(var Msg: TMessage);
begin
inherited;
Msg.Result := Msg.Result or DLGC_WANTARROWS or DLGC_WANTTAB;
end;
procedure TMyPanel.KeyDown(var Key: Word; Shift: TShiftState);
begin
end;
procedure TMyPanel.KeyUp(var Key: Word; Shift: TShiftState);
begin
end;
procedure TMyPanel.KeyPress(var Key: Char);
begin
end;
function TMyPanel.DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean;
begin
end;
function TMyPanel.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean;
begin
end;
end.