删除组合框中的seleleted项目 [英] remove seleleted items in combobox

查看:66
本文介绍了删除组合框中的seleleted项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从组合框中删除一个选定的项目。例如,如果我在组合框中选择数字3,则立即删除该数字。这是我的代码。
i需要帮助

If ComboBox1.Text IsNot "" Then
                ComboBox1.Items.Remove(ComboBox1.SelectedItem)
            End If







推荐答案


我想从组合框中删除所选项目。例如,如果我在组合框中选择数字3,则立即删除该数字。这是我的代码。

您尚未说明问题所在。 有错误吗? 如果是这样,该消息通常表明问题的根源。 或者代码是否做了除您预期之外的其他事情?  它做了什么,你期待什么? 
请参阅:

https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/add-and-remove-items-from-a-wf-combobox

You haven't indicated what the problem is.  Is there an error?  If so, the message usually indicates the source of the problem.  Or does the code do something other than what you expected?   What does it do, and what did you expect?  See:
https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/add-and-remove-items-from-a-wf-combobox


这篇关于删除组合框中的seleleted项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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