按回车键,焦点跳转至下一个控件

  if  (Key <> 13) or (ActiveControl = nil) or (ActiveControl.ClassName = 'TMemo') then
    Exit;
  if ActiveControl.ClassName <> 'TDBGrid' then
    Perform(WM_Nextdlgctl,0,0);

  if ActiveControl.ClassName = 'TDBGrid' then
  begin
    with TDBGrid(ActiveControl) do
    begin
      if (DataSource = nil) or (DataSource.State in [dsInactive, dsOpening]) then
        Exit;
      if SelectedIndex = Columns.Count -1 then
      begin
        DataSource.DataSet.Next;
        SelectedIndex := 0;
      end else
        SelectedIndex :=SelectedIndex +1;
    end;
  end;

按回车键,焦点跳转至下一个控件

 

你可能感兴趣的:(跳转)