Ver Mensaje Individual
  #3  
Antiguo 04-07-2011
gsilvei gsilvei is offline
Miembro
 
Registrado: jul 2006
Posts: 44
Reputación: 0
gsilvei Va por buen camino
Hola,
tengo el botón criado en el evento OnDrawColumnCell:

Código Delphi [-]
  
procedure TFormPrincipal.Grid_propostaDrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn;
  State: TGridDrawState);
var 
  BUTTON: Integer; 
  R: TRect; 
  SCapt : string;

begin
if Column.FieldName = 'P_OBS_INATIVO' then
  begin 
    Grid_proposta.Canvas.FillRect(Rect);
    BUTTON := 0; 
    R:=Rect; 
    SCapt := 'Ren.';
    InflateRect(R,-2,0); 
    DrawFrameControl(Grid_proposta.Canvas.Handle,R,BUTTON, BUTTON or BUTTON); 
    with Grid_proposta.Canvas do
    begin 
      Brush.Style := bsClear; 
      Font.Color := clBtnText; 
      TextRect(Rect, (Rect.Left + Rect.Right - TextWidth(SCapt)) div 2, (Rect.Top + Rect.Bottom - TextHeight(SCapt)) div 2, SCapt); 
    end; 
  end;
end;
Saludos
Responder Con Cita