Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 28-07-2016
Avatar de BDWONG
BDWONG BDWONG is offline
Miembro
NULL
 
Registrado: nov 2013
Posts: 113
Poder: 11
BDWONG Va por buen camino
Genial ecfisa entras mas soluciones mejor le voy a dar una revisada a tu codigo.
Saludos..
Responder Con Cita
  #2  
Antiguo 28-07-2016
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Una pequeña variante:

Código Delphi [-]
interface

type
  TStringGrid = class(Grids.TStringGrid)
  protected
    function CreateEditor: TInplaceEdit; override;
  end;

implementation

{ TStringGrid }

const
  clHiglightCell = clYellow;

type
  TEditor = class(TInPlaceEdit);

function TStringGrid.CreateEditor: TInplaceEdit;
begin
  Result := inherited CreateEditor;
  TEditor(Result).Color := clHiglightCell;
end;

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
  with Sender as TStringGrid do
  begin
    if (ARow = Row) then
    begin
      if (ACol = Col) then
        Canvas.Brush.Color := clHiglightCell
      else
      begin
        Canvas.Brush.Color := clHighlight;
        Canvas.Font.Color := clHighlightText;
      end;

      Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, Cells[ACol, ARow]);
    end;
  end;
end;

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean);
begin
  with Sender as TStringGrid do
  begin
    if ARow <> Row then
      Invalidate;
  end;
end;

DefaultDrawing debe ser true y goRowSelect debe ser false.

LineComment Saludos
Responder Con Cita
Respuesta



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
como ver un tipo de datos de una grilla en otra grilla en el mismo form? calistian Varios 5 01-10-2008 19:29:04
La Grilla YOSMITH Gráficos 1 13-06-2007 22:11:50
Coleres en las Grilla josem Varios 6 06-06-2007 20:05:15
Grilla :-( AndyLupa Varios 0 20-04-2006 15:51:18
bandas en grilla Andrea Martinez Varios 0 10-07-2004 06:42:22


La franja horaria es GMT +2. Ahora son las 02:19:41.


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