listviewitem

  • Thread starter Thread starter plork
  • Start date Start date
P

plork

hi all can anyone show me how i add a button to each row in a
listview?

i'm adding each row like this but i need to add a button as well

lv = new ListViewItem(id);
lv.SubItems.Add(xx);
lv.SubItems.Add(yy);

m_lstView.Items.AddRange(new ListViewItem[] { lv });

when i do AddRange i need to add a button, can anyone help me out
 
Short form, you can't.

You could handle custom painting for the ListView, painting your
buttons, responding to user input, but quite frankly, that's going to be a
massive PITA. You don't want to do this.

There really isn't a good way to do this. I'd look into another way of
trying to accomplish what you are doing.

If you were using WPF (which I am pretty sure you are not), you could
place the buttons into the ListView easily, as WPF supports composition at a
fundamental level.
 
Back
Top