tags:

views:

47

answers:

2

I'd like to add an option to my ListView, so that I can change it's view (tile, list, details,...) - just like in Windows Explorer. How can I build such a menu? With PictureBox and MenuStrip?

alt text

PS: winforms, not WPF

Thanks!

+1  A: 

Set its ContextMenuStrip property. Choosing Details does require you to add Columns.

Hans Passant
A: 

How I did it:

  1. I created new user control and added a button with this icon.
  2. Then I added ContextMenu with all five items.
  3. Button.OnClick shows ContextMenu
  4. Added public event for ItemClicked with parameter View
  5. Added public property for selected view
_simon_