ListView中的TextBox要添加包含现有项目的新项目 [英] TextBox In Listview To Add New item with existing items
本文介绍了ListView中的TextBox要添加包含现有项目的新项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果item的计数不为零,我想在列表视图中的最后一项之后显示一个文本框。但如果为零,则必须在顶部显示文本框。
我尝试设置文本框的位置
I want to show a textbox after the last item in a list view if count of item is not zero. But if zero, textbox must be shown on top.
I tried with setting location of textbox by
TextBox1.location=new point(0,listviewStaticVar.items.count+1);
但是我错过了设置位置帮助的东西。
谢谢。
But I am missing something to setting location pls help.
Thank you.
推荐答案
y
-componentTextBox1.Location
应该是 ListView.Items.Count [ ^ ]以及其中一个项目的高度(以像素为单位)。您可以使用 ListViewItem.Bounds [ ^ ]。
只检查是否有任何项目,如果没有,则使用零分量。
They
-component ofTextBox1.Location
should be the product of a ListView.Items.Count[^] and the height of one of the items in pixels. You can use ListViewItem.Bounds[^] for that.
Just check if there are any items, and use an y-component of zero if not.
这篇关于ListView中的TextBox要添加包含现有项目的新项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文