Ver Mensaje Individual
  #2  
Antiguo 26-08-2013
Avatar de TiammatMX
TiammatMX TiammatMX is offline
Miembro
 
Registrado: jun 2006
Ubicación: Universo Curvo\Vía Láctea\Sistema Solar\Planeta Tierra\América\México\Puebla\Heróica Puebla de Zaragoza\Jardines de San Manuel\Home
Posts: 746
Reputación: 18
TiammatMX Va camino a la fama
Red face

Un compañero me proporcionó éste código:

Código Delphi [-]
procedure TForm1.StringGrid1MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
var
  R, C: Integer;
begin
  StringGrid1.MouseToCell(X, Y, C, R);
  with StringGrid1 do
  begin
    if ((Row<>R)or(Col<>C)) then
    begin
      Row:=R;
      Col:=C;
      Application.CancelHint;
      StringGrid1.Hint:=IntToStr(R)+#32+IntToStr(C);
    end;
  end;
end;

El cual modifiqué así:
Código Delphi [-]
procedure TfrmPrescripcionDieteticaInicial.stgProcesarMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
  R, C: Integer;
  sHint : string;
begin
   if (Sender).ClassType = TStringGrid then
   begin
      stgProcesar.MouseToCell(X, Y, C, R);
      if (R > 2) and (C > 3) then
      begin
         with stgProcesar do
         begin
            if ((Row <> R) or (Col <> C)) then
            begin
               Row := R;
               Col := C;
               sHint := CapitalFirst(BuscaHint(Cells[C,2]));
               if Trim(sHint) > '' then
               begin
                  Application.CancelHint;
                  Hint := sHint;
               end;
            end;
         end;
      end;
   end;
end;

...y queda haciendo EXACTAMENTE lo que necesito.
__________________
Felipe Eduardo Ortiz López. Delphi programmers does it recursively...

"Un programador, es un creador de universos en donde sólo él es responsable. Universos de complejidad prácticamente ilimitada que se puede crear en forma de programas de ordenador." - Joseph Weizenbaum.

Témele a los profetas... y a aquellos que están listos para morir por "la verdad", ya que como regla general hacen morir a muchos otros con ellos, frecuentemente antes que ellos, y a veces en lugar de ellos. — Umberto Eco
Responder Con Cita