Adding button into a Listview in WinForms

后端 未结 11 2353
天命终不由人
天命终不由人 2020-11-28 11:15

Is there a way to add a button control to a cell in inside a ListView in a WinForms app?

11条回答
  •  一个人的身影
    2020-11-28 11:46

    To make the extender of Simon Mourier working is missing the following line:

    extender.AddColumn(buttonAction);
    

    This is, it should look like:

    ListViewExtender extender = new ListViewExtender(listSummary);
    ListViewButtonColumn buttonAction = new ListViewButtonColumn(2);
    buttonAction.Click += OnButtonActionClick;
    buttonAction.FixedWidth = true;
    extender.AddColumn(buttonAction);
    

提交回复
热议问题