下载本文示例代码
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;
共3页。 1 2 3 8 :
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;
共3页。 1 2 3 8 :
下载本文示例代码
Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下Delphi数据库输入控件DBPanel的实现下
阅读(239) | 评论(0) | 转发(0) |