procedure TForm1.AdvStringGrid1ColChanging(Sender: TObject; OldCol, NewCol: Integer; var Allow: Boolean); begin if NewCol = 3 then Showmessage('c3') else if NewCol = 4 then ShowMessage('c4'); end;
楼上错了吧,是oldcol if oldcol=3 then showmessage('3'); if oldcol=4 then showmessage('4');
NewCol: Integer; var Allow: Boolean);
begin
if NewCol = 3 then
Showmessage('c3')
else if NewCol = 4 then
ShowMessage('c4');
end;
if oldcol=3 then
showmessage('3');
if oldcol=4 then
showmessage('4');