dotnet/winforms

Discussion/Proposal: more ListViewGroup functionality

Open

#2,623 opened on 2020年1月3日

GitHub で見る
 (8 comments) (4 reactions) (2 assignees)C# (922 forks)batch import
api-suggestionarea-controls-ListViewhelp wantedinvestigatetenet-compatibility-OS

Repository metrics

Stars
 (4,100 stars)
PR merge metrics
 (平均マージ 14d 22h) (30d で 56 merged PRs)

説明

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

コントリビューターガイド