AlphaSkin Demo app – ListView sort arrow

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #68777
    Support
    Keymaster

    Do you mean the SortType property?

    #68779
    Stephane Senecal
    Participant

    I’m talking about the use of HDF_SORTDOWN = $0200 and HDF_SORTUP = $0400 in the procedure TsCustomListView.ColumnSkinPaint.

    But I just realized that this feature is not available through de VCL. It must be called directly using the win32 api.

    Sample code I found on the Internet

    procedure TForm1.sListView1ColumnClick(Sender: TObject; Column: TListColumn);
    const
      HDF_SORTDOWN = $0200;
      HDF_SORTUP   = $0400;
    var
      Header: HWND;
      Item: THDItem;
    begin
      Header := ListView_GetHeader(TWinControl(Sender).Handle);
      ZeroMemory(@Item, SizeOf(Item));
      Item.Mask := HDI_FORMAT;
      Header_GetItem(Header, Column.Index, Item);
      Item.fmt := Item.fmt and not (HDF_SORTUP or HDF_SORTDOWN);//remove both flags
      Item.fmt := Item.fmt or HDF_SORTUP;//include the sort ascending flag
      Header_SetItem(Header, Column.Index, Item);
    end;

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #68781
    Support
    Keymaster

    I will try to add it in the demo soon, thanks.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.