如何编写包含图像、文本和按钮的 ListViewItem? [英] How to write ListViewItem that contain image , text and button?

查看:30
本文介绍了如何编写包含图像、文本和按钮的 ListViewItem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写一些 listViewItem(使用 WPF) - 包含图像、文本和按钮.

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

我想从简单的 listViewItem 类继承并添加到包含三个项(图像、文本、按钮)的列表视图项中.

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

我不明白 listView 控件如何在控件中以正确的顺序排列 3 个项目(图像、文本、按钮)——如何告诉列表视图控件图像是第一,文本是第二和按钮是第三个?

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 ?

推荐答案

首先阅读有关布局控件的更多信息.像 StackPanel 和 Grid - 这样你就可以了解如何排列项目.然后阅读模板.此处给出了与您的任务非常相似的任务的解决方案:http://www.codewrecks.com/blog/index.php/2008/03/26/first-steps-on-wpf-listview-with-template-based-on-data/

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/

这篇关于如何编写包含图像、文本和按钮的 ListViewItem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆