Ver Mensaje Individual
  #2  
Antiguo 06-05-2008
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola

No encontré ningun evento que se dispare al abandonar una celda, pero prueba esto:

Código PHP:
var
  
Form1: TForm1;
  
XCol,XRow: integer;
 
implementation {$R *.dfm}
 
{ 
TOMAR POSICION DE CELDA ACTUAL }
procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
  
ARow: Integer; var CanSelect: Boolean);
begin
  XCol
:= ACol; // TOMAR COLUMNA ACTUAL
  
XRow:= ARow; // TOMAR FILA ACTUAL
end;
 
{ 
DETECTAR SALIDA DE CELDA }
procedure TForm1.StringGrid1KeyDown(Sender: TObject; var Key: Word;
  
Shift: TShiftState);
begin
  
// TECLAS CON LAS QUE ABANDONAMOS UNA CELDA...
  
if Key in [VK_DOWN, VK_UP, VK_LEFT, VK_RIGHT] then
  begin
    
// ACA LO  QUE QUIERAS HACER ...
    //...
    
Label1.Caption:= StringGrid1.Cells[XCol, XRow]; // ej. trivial
  
end;
end; 
Seguro que alguien aportará una mejor solución pero mientras tanto... espero te ayude
Responder Con Cita