保存数据后如何重置组合框 [英] How to reset the combobox after save the data

查看:69
本文介绍了保存数据后如何重置组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PLZ帮助我我的combox不清除&重置后保存来自。

plz Help me my combox not clear & reset After Save the from.

推荐答案

如果要清除当前选择,但保留所有项目列表,你可以使用:

If you want to clear the current selection, but leave all of the items in the list, you can use:
ComboBox1.SelectedIndex = -1;





如果你想清除组合框你可以尝试



If you want to clear the combobox you can try

ComboBox1.Items.Clear();



或者如果你有绑定那么


Or if you have binding then

ComboBox1.DataSource=null;


保存数据后只需将组合框选择的索引更改为-1

,如
Hi, after saving data just change your combobox selected index to -1
like
combobox.SelectedIndex = -1;


首先在组合框中有一个空白值。保存后,您需要指定空白值或空白值索引
First have to one blank value in your combobox. After save you need to assign blank value or blank value index


这篇关于保存数据后如何重置组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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