dotnet/winforms

Discussion/Proposal: more ListViewGroup functionality

Open

#2 623 ouverte le 3 janv. 2020

Voir sur GitHub
 (8 commentaires) (4 réactions) (2 assignés)C# (922 forks)batch import
api-suggestionarea-controls-ListViewhelp wantedinvestigatetenet-compatibility-OS

Métriques du dépôt

Stars
 (4 100 stars)
Métriques de merge PR
 (Merge moyen 14j 22h) (56 PRs mergées en 30 j)

Description

State of Play

Missing Feature Parity

Support For Images

  • You can set the LVSIL_GROUPHEADER list view image list
  • You can set the LVGF_TITLEIMAGE flag on mask and set iTitleImage to a valid index into the LVSIL_GROUPHEADER image list

This would add the following APIs to ListView and ListViewGroup:

public class ListView
{
    ...
    public ImageList GroupHeaderImageList { get; set; }
    ...
}
public class ListViewGroup
{
    ...
    public int TitleImageIndex { get; set; }
    ...
}

E.g. image

Collapsible

This would add the following APIs to ListViewGroup:

public class ListViewGroup
{
    ...
    public bool Collapsible { get; set; }
    ...
}

E.g. Screen Recording 2020-01-03 at 08 10 pm

Discussion

  • The rightmost collapse/expand icon doesn't work: to fix this we need to call base.WndProc in WM_LBUTTONUP handler

Collapsed

  • Can set the LVGF_STATE flag on uMask and set stateMask to LVGS_COLLAPSED and state to LVGS_COLLAPSED

This would add the following APIs to ListViewGroup:

public class ListViewGroup
{
    ...
    public bool Collapsed { get; set; }
    ...
}

E.g. Screen Recording 2020-01-04 at 06 57 pm

HeaderVisible

  • Can set the LVGF_STATE flag on uMask and set stateMask to LVGS_NOHEADER and state to LVGS_NOHEADER

This would add the following APIs to ListViewGroup:

public class ListViewGroup
{
    ...
    public bool HeaderVisible { get; set; } = true;
    ...
}

E.g. Screen Recording 2020-01-04 at 07 05 pm

Description Top/Bottom

  • You can set the LVGF_DESCRIPTIONTOP flag on mask and set pszDescriptionTop to a valid string and cchDescriptionTop to the length of the string
  • You can set the LVGF_DESCRIPTIONBOTTOM flag on mask and set pszDescriptionBottom to a valid string and cchDescriptionBottom to the length of the string

This would add the following APIs to ListViewGroup:

public class ListViewGroup
{
    ...
    public string TopDescription { get; set; }
    public string BottomDescription { get; set; }
    ...
}

E.g. image

/cc @weltkante @RussKie

Guide contributeur