Ver Mensaje Individual
  #14  
Antiguo 04-05-2011
Avatar de José Luis Garcí
[José Luis Garcí] José Luis Garcí is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Las Palmas de G.C.
Posts: 1.372
Reputación: 22
José Luis Garcí Va camino a la fama
Hola oscara, acabo de probar el componente con un par de edit y grid y no me hace lo que me comentabas en el mensaje privado, no veo que afecte al grid, de todas maneras puedes cambiar el código de:

Código Delphi [-]
procedure TCenterScreenColor.AdmitComponent(Component:TWinControl);
begin
     if (Component is TCustomForm) then
     if Component.ClassType=Tform then
     begin
         if FForm=true then VarPrivPassComponent:=True
                       else VarPrivPassComponent:=False;
     end else
     begin
        if ((Component is TCustomEdit) or (Component is TDateTimePicker))then
        begin
           if FEdit_DBEdit=true then VarPrivPassComponent:=True
           else VarPrivPassComponent:=False;
        end else
        begin
           if (Component is TCustomMemo) then
           begin
              if FMEmo_DbMEmo=true then VarPrivPassComponent:=True
                                   else VarPrivPassComponent:=False;
           end else
           begin
              if (Component is TCustomComboBox) then
              begin
                  if FComboBox_DBCombobox=true then VarPrivPassComponent:=True
                                               else VarPrivPassComponent:=False;
              end else
              begin
                 if FOther=true then VarPrivPassComponent:=True
                                else VarPrivPassComponent:=False;
              end;
           end;
        end;
     end;
end;

por

Código Delphi [-]
procedure TCenterScreenColor.AdmitComponent(Component:TWinControl);
begin
   if not (Component is TCustomDBGrid) then
   begin
     if (Component is TCustomForm) then
     if Component.ClassType=Tform then
     begin
         if FForm=true then VarPrivPassComponent:=True
                       else VarPrivPassComponent:=False;
     end else
     begin
        if ((Component is TCustomEdit) or (Component is TDateTimePicker))then
        begin
           if FEdit_DBEdit=true then VarPrivPassComponent:=True
           else VarPrivPassComponent:=False;
        end else
        begin
           if (Component is TCustomMemo) then
           begin
              if FMEmo_DbMEmo=true then VarPrivPassComponent:=True
                                   else VarPrivPassComponent:=False;
           end else
           begin
              if (Component is TCustomComboBox) then
              begin
                  if FComboBox_DBCombobox=true then VarPrivPassComponent:=True
                                               else VarPrivPassComponent:=False;
              end else
              begin
                 if FOther=true then VarPrivPassComponent:=True
                                else VarPrivPassComponent:=False;
              end;
           end;
        end;
     end;
  end;
end;

Lo que haría es si el componente es un Dbgrid (LLamo al ancestro de los Dbgrid, para que admita la mayor parte de ellos), no sigue y si es otro componente si.

Me imagino ya que no lo he probado que deberas incluir la unidad Dbgrids.
__________________
Un saludo desde Canarias, "El abuelo Cebolleta"
Responder Con Cita