GridFocus:integer;
GridFocus:=1;
GridFocus:=2;
case GridFocus of 1:showmessage('Grid1'); 2:showmessage('Grid2'); end;