如何编写包含图像、文本和按钮的ListViewItem?

发布于 2024-09-26 19:56:17 字数 207 浏览 0 评论 0原文

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

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

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

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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩发小公举 2024-10-03 19:56:17

首先阅读有关布局控件的更多信息。像 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文