简体   繁体   English

如何使用项目创建 ListView 以添加项目

[英]How to create ListView with item to add items

I am new on xaml, vb.net and coding.我是 xaml、vb.net 和编码的新手。 I'm trying to make an app with ListView.我正在尝试使用 ListView 制作应用程序。 I know how to use ListView but I want another kind of ListView: a ListView with one item which allow us to add an item.我知道如何使用 ListView,但我想要另一种 ListView:一个带有一个项目的 ListView,它允许我们添加一个项目。

I don't know how do that.我不知道该怎么做。 Maybe UserControl?也许是用户控制?

I attached a sketch for better understanding.我附上了一张草图以便更好地理解。

草图

There are a couple ways to go about this. go 关于这个有几种方法。 Basically, it all comes down to using some Event to trigger the creation of a new item.基本上,这一切都归结为使用一些Event来触发新项目的创建。 One option is to make the last item a Button and handle the Click event.一种选择是将最后一项设为Button并处理Click事件。 In the event handler, you would have code to insert an item one place before the last item in the list.在事件处理程序中,您将有代码在列表中的最后一项之前插入一项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM