TCustomDBGrid.SelectedField就可以了.以下摘自Delphi帮助文件:
The following code concatenates an asterisk to the display label of a field when the column is entered, and removes it when another column is selected. StarIsThere is a boolean that prevents deleting characters from the column that is selected at startup (which never receives an OnColEnter event).
var
StarIsThere: Boolean;
procedure TForm1.DBGrid1ColEnter(Sender: TObject);
begin
with DBGrid1.SelectedField do
DisplayLabel := '* ' + DisplayLabel;
StarIsThere = True;
end
procedure TForm1.DBGrid1ColExit(Sender: TObject);
var
TheLabel: string;
begin
if StarIsThere then
begin
with DBGrid1.SelectedField do
begin
TheLabel := DisplayLabel;
Delete(TheLabel, 1, 2);
DisplayLabel := TheLabel;
end;
end;
end;