Cita:
Empezado por Caro
Lo que pasa amiguito es que el parametro Rect lo tiene en el evento OnDrawCell y el quiere colocar la imagen despues de hacer su consulta osea que no se estaría en el evento OnDrawCell.
|
Asi es amiguita, no coloque el nombre del evento OnDrawCell porque asumí que estabamos en ese evento, el "pintado" de las imagenes se hace en ese evento, aqui te muestro lo que yo hago.....
Código Delphi
[-]function TFcalendar.MaidSt(Habitacion:String):Integer;
begin
With DataModule1.QMaidStatus do begin
SQL.Text := 'SELECT STATUS FROM MAIDSTATUS WHERE HABITACION = "'+Habitacion+'"';
Open;
Result := fields[0].AsInteger;
Close;
end;
end;
procedure TFcalendar.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
with Sender as TStringGrid do begin
if (ACol=0) then begin
Case MaidSt(StringGrid1.Cells[0,ARow]) of
3 : StringGrid1.Canvas.Draw(Rect.Left+34, Rect.Top, Image2.Picture.Graphic);
4 : StringGrid1.Canvas.Draw(Rect.Left+34, Rect.Top, Image3.Picture.Graphic);
5 : StringGrid1.Canvas.Draw(Rect.Left+34, Rect.Top, Image1.Picture.Graphic);
end;
end;
end;
end;
Salud ITOS