ListView 和 BeginEdit 方法
我有一个列表视图。当我调用 listview.SelectedItems[0].BeginEdit()
时,它能够更正所选项目。当我结束编辑我的项目时,例如按“Enter”等按钮,需要调用什么事件?
首先,当用户选择 ToolStripMenuItem 时,会发生以下事件:
private void renameLocalUserToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listView_ad.SelectedItems.Count > 0)
{
listView_ad.SelectedItems[0].BeginEdit();
}
}
当用户结束更改其项目时,他按“enter”键。然后我需要获取更改后的文本。
I have a ListView. When I call listview.SelectedItems[0].BeginEdit()
, it is able to correct the selected item. What event needs to be called, when I end edit my item, for example, press such button as "Enter"?
At first, when the user selects ToolStripMenuItem it is occurs so event:
private void renameLocalUserToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listView_ad.SelectedItems.Count > 0)
{
listView_ad.SelectedItems[0].BeginEdit();
}
}
When the user ends changing his item, he presses "enter". And then I need to take the changed text.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用“AfterLabelEdit”事件。
MSDN标签编辑后
Use the 'AfterLabelEdit' event.
MSDN AfterLabelEdit
您的问题不太清楚,但我认为您需要的是处理
AfterLabelEdit
事件。Your question is not quite clear, but I think what you need is to handle the
AfterLabelEdit
event.您可能正在寻找 AfterLabelEdit 事件。
You may be looking for the AfterLabelEdit event.