C# - Adding Button inside ListBox

后端 未结 5 447
陌清茗
陌清茗 2021-01-12 15:13

I\'m writing an C# App (WinForm) with a ListBox having content added by the user. Now, I could have a ordinary button under the ListBox to remove items, but I would like to

5条回答
  •  臣服心动
    2021-01-12 15:53

    So one could make a custom control but for my app it isn't really worth the trouble.

    What I did was to create a DataGrid, made it resemble a ListView but with its own flare. I did this because the DataGrid already has a buttoncontrol built in to its cells.

    Yes I know, kind of fugly "hack", but it works like a charm! :)

    Props to Shay Erlichmen who led me into thinking outsite my ListBox. See what I did there? ;)

提交回复
热议问题