dotnet/winforms

Setting `ListView.CheckBoxes` after `ListView.StateImageList` destroys imagelist

開放

#3,531 建立於 2020年7月1日

 (2 則留言) (0 個反應) (0 位負責人)C# (922 個分叉)batch import
:beetle: bug:construction: work in progressarea-controls-ListViewhelp wanted

倉庫指標

星標
 (4,100 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

  • Have you experienced this same bug with .NET Framework?: Yes

Problem description:

An outcome of investigations in https://github.com/dotnet/winforms/issues/3358, in the following scenarios CheckBoxes is toggled whilst a user-supplied imagelist is bound to StateImageList property - the native listview control will tarnish the user-supplied one.

The issue is reproducible in net4x and netcore3.1.

listview-cb-off

listview-cb-on

Additionally, it appears changes in one instance of listview may affect another, if state imagelist were similar (e.g. contain the same set of images), as the native layer may be caching.

Expected behavior:

Changes CheckBoxes property does no affect a user-supplied imagelist.

Minimal repro:

https://github.com/RussKie/ListViewCheckboxesStateImageList

Also the issue is easily reproducible in .NET Framework designer by setting up the StateImageList property on a ListView control, (save), and then setting CheckBoxes=true.

貢獻者指南