Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 19-07-2005
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Poder: 31
Lepe Va por buen camino
Aunque la verdad, no creo que haya que complicarse tanto la vida por tan poca cosa:
Código Delphi [-]
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; 
  DataCol: Integer; Column: TColumn; State: TGridDrawState); 
var 
  Check: Integer; 
  R: TRect; 
begin 
  if Column.FieldName = 'NombreCampo' then 
  begin 
    DBGrid1.Canvas.FillRect(Rect); 
    Check := 0; 
    if Table1.FindField('NombreCampo').AsInteger = 1 then Check := DFCS_CHECKED; 
    R:=Rect; 
    InflateRect(R,-2,-2); //Disminuye el tamaño del CheckBox 
    DrawFrameControl(DBGrid1.Canvas.Handle,R,DFC_BUTTON, DFCS_BUTTONCHECK or Check); 
  end; 
end; 


procedure TForm1.DBGrid1CellClick(Column: TColumn); 
begin 
  if Column.FieldName = 'NombreCampo' then 
  begin 
    Table1.Edit; 
    if Table1.FindField('NombreCampo').AsInteger = 1 then
    Table1.FindField('NombreCampo').AsInteger := 0
    else
    Table1.FindField('NombreCampo').AsInteger := 1
    Table1.Post;
    Dbgrid1.Refresh; // quizás más bien un Repaint.... pero en fin.
  end; 
end;
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 06:15:28.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi