Delphi数据库输入控件DBPanel的实现下

2008-04-09 04:18:15来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

Published declarations }

end;

procedure Register;
implementation
procedure Register;
begin
RegisterComponents("Additional", [TDBPanel]);
end;

{ 为第I字段增加提示信息的方法}

procedure TDBPanel.AddHits(ItemIndex: Integer; Hits: array of string);
var
m,n,i: Integer;
begin
n := Length(Editors);
m := Length(Hits);
if ItemIndex$#@60;n then begin
for i:=0 to m-1 do Editors[ItemIndex].Items.Add(Hits[i]);
end;
end;

procedure TDBPanel.AKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Sender is TDBComboBox) then begin
case Key of
VK_Next: (Sender as TDBComboBox).DataSource.DataSet.Next;
VK_PRIOR: (Sender as TDBComboBox).DataSource.DataSet.Prior;
end;
end;
end;

procedure TDBPanel.AKeyPress(Sender: TObject; var Key: Char);
begin
if (Sender is TDBComboBox) then begin
if Key=#13 then (Owner as TForm).Perform(WM_NEXTDLGCTL, 0, 0);
end;
end;

procedure TDBPanel.ClearHits(ItemIndex: Integer);
var
n: Integer;
begin
n := Length(Editors);
if ItemIndex$#@60;n then Editors[ItemIndex].Items.Clear;
end;

constructor TDBPanel.Create(AOwner: TComponent);
begin
Inherited Create(AOWner);
FLeft :=10;
FTop := 10;
maxTextLen := 100;
maxLabelLen := 100;
FLineHeight := 15;
end;

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Delphi3如何调用Excel

下一篇:Delphi之三十六计之系统篇

热门词条
热门标签