开发者

Listview - menu for switching item

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 http://img689.imageshack.us/img689/6792/temprt.jpg

PS: winforms, not WPF

Thank开发者_开发知识库s!


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


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜