Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 12-11-2008
Dark_RavenM Dark_RavenM is offline
Miembro
 
Registrado: dic 2007
Posts: 25
Poder: 0
Dark_RavenM Va por buen camino
respuesta

Me ayudaron con el problema con este codigo, todos los creditos a su autor paco

Debe estar ligado al evento OnDblClick de tu StringGrid.

Código Delphi [-]
procedure TfrmCatalogos.StringGrid1DblClick(Sender: TObject); 
var 
  rAnt: TRect; 
  oMousePt: TPoint; 
  nRow, nCol, nWidth, nWidthMax: Integer; 
begin 

  oMousePt := Mouse.CursorPos; 
  oMousePt := StringGrid1.ScreenToClient(oMousePt); 

  for nCol := 1 to StringGrid1.ColCount - 1 do 
    begin 
      rAnt := StringGrid1.CellRect(nCol,0); 
      if (oMousePt.X >= rAnt.Right - 3) and 
        (oMousePt.X <= rAnt.Right + 4) and 
        (oMousePt.Y in [rAnt.Top..rAnt.Bottom]) then 
        begin 
          nWidthMax := 0; 
          for nRow := 0 to (StringGrid1.RowCount - 1) do begin 
            if nRow = 0 then //El header es bold 
              StringGrid1.Canvas.Font.Style := [fsBold] 
            else //Las demás líneas no son bold 
              StringGrid1.Canvas.Font.Style := []; 
            nWidth := StringGrid1.Canvas.TextWidth(StringGrid1.Cells[nCol, nRow]); 
            if nWidth > nWidthMax then 
              nWidthMax := nWidth; 
          end; 
          StringGrid1.ColWidths[nCol] := nWidthMax + 5; 
        end; 
    end; 

end;

Última edición por Neftali [Germán.Estévez] fecha: 13-11-2008 a las 10:41:21.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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
Dar control a una Celda en un TStringGrid Jorge Rojas M. OOP 1 03-04-2008 02:36:09
evento expandir (+) en cxGrid sakuragi OOP 3 15-08-2006 21:09:58
expandir un nivel al TreeView... Essato OOP 4 25-06-2005 01:18:19
Expandir imagen en un SpeedButton (URGENTE !!) jymy788 Varios 1 10-09-2004 16:53:14
Expandir TreeView Taribus Varios 1 05-10-2003 20:48:23


La franja horaria es GMT +2. Ahora son las 21:33:34.


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