How to write ListViewItem that contain image , tex

2019-08-30 04:37发布

I need to write some listViewItem ( using WPF ) - that contain image, text and button.

I want to inherit from the simple listViewItem class and add to the listview item that contain the three items ( image, text, button ).

I don't understand how the listView control will arrange the 3 items ( image , text, button ) in the right order in the control - how to tell the listview control that the image is first, text is second and the button is the third ?

1条回答
Juvenile、少年°
2楼-- · 2019-08-30 05:02

First read more about Layout controls. like StackPanel and Grid - so you can understans how to arrange items.Then read about templates. Solution for a task which is very similar to yours is given here: http://www.codewrecks.com/blog/index.php/2008/03/26/first-steps-on-wpf-listview-with-template-based-on-data/

查看更多
登录 后发表回答