Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
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
  #2  
Antiguo 09-12-2007
Avatar de xEsk
[xEsk] xEsk is offline
Miembro Premium
 
Registrado: feb 2006
Posts: 454
Poder: 21
xEsk Va por buen camino
Hola, hace algún tiempo implementé el código que realiza lo que buscas, aquí lo tienes:
Código Delphi [-]
procedure SetColumnImage(const ListView: TListView; Column: Integer; Down: Boolean);
var
  n: Integer;

  procedure RemoveImage(Index: Integer);
  var
    Header: THandle;
    HDItem: THDItem;

  begin
    // Get the ListView Header Handle
    Header := ListView_GetHeader(ListView.Handle);
    FillChar(HDItem, SizeOf(HDItem), 0);
    HDItem.Mask := HDI_BITMAP or HDI_IMAGE or HDI_FORMAT;
      // current status secure
    Header_GetItem(Header, Index, HDItem);
    // arrow delete
    HDItem.fmt := HDItem.fmt and not HDF_SORTUP and not HDF_SORTDOWN
      and not HDF_BITMAP_ON_RIGHT and not HDF_IMAGE;
    // changes use
    Header_SetItem(Header, Index, HDItem);
  end;

  procedure SetImage(Index: Integer; Direction: Boolean);
  var
    Header: THandle;
    HDItem: THDItem;

  begin
    // Get the ListView Header Handle
    Header := ListView_GetHeader(ListView.Handle);
    FillChar(HDItem, SizeOf(HDItem), 0);
    HDItem.Mask := HDI_BITMAP or HDI_IMAGE or HDI_FORMAT;
    // current status secure
    Header_GetItem(Header, Index, HDItem);
    // arrow is to appear right
    HDItem.fmt := HDItem.fmt and not HDF_SORTUP and not HDF_SORTDOWN
      and not HDF_IMAGE or HDF_BITMAP_ON_RIGHT;
    // set direction
    if Direction = true then //sdUp then
      HDItem.fmt := HDItem.fmt or HDF_SORTUP
    else
      HDItem.fmt := HDItem.fmt or HDF_SORTDOWN;
    // changes use
    Header_SetItem(Header, Index, HDItem);
  end;

begin
  // remove icons
  for n:=0 to ListView.Columns.Count - 1 do
    RemoveImage(n);
  // set the "arrow icon"
  SetImage(Column, not Down);
end;
El parámetro Down: Boolean sirve para indicar si la dirección es mirando hacia abajo, en caso de que "Down" sea false, entonces pinta la flecha mirando para arriba.

Ejemplo de uso:
Código Delphi [-]
procedure TForm1.FormCreate(Sender: TObject);
begin
  SetColumnImage(ListView1, 0, false);
end;
Saludos, espero que te sea útil.

Editado: Se me olvidó poner que se debe añadir "CommCtrl" en los USES!

Última edición por xEsk fecha: 09-12-2007 a las 22:41:38.
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
Interesante Librero egostar La Taberna 6 12-07-2007 04:38:17
Web interesante FunBit Seguridad 5 05-09-2005 14:27:03
Problema interesante hgiacobone Tablas planas 4 10-06-2005 19:41:13
Virtual Listview e iconos virtuales. Muy interesante pero... Playwithfire Varios 4 14-10-2004 15:06:28
Interesante pregunta.... Pandre Internet 0 18-09-2003 03:31:24


La franja horaria es GMT +2. Ahora son las 21:51:31.


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