如何清除组合框? [英] How do I clear a combobox?

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

问题描述

我有被设置为下拉列表中的一些组合框,用户可以选择在其中的一个数字。我也有一个清除按钮应该清除组合框的文本,但我似乎无法得到它。我试过:

  //不起作用
cboxHour.Text =;

  //不起作用
cboxHour.ResetText();

这看起来应该是这样简单的,但我只是没有得到它。


解决方案

你有没有尝试 cboxHour.Items.Clear() <? / p>

I have some combo-boxes that are set up as drop down lists, and the user can pick a number in them. I also have a Clear button that should clear the text from the combo boxes but I can't seem to get it. I've tried:

 //doesn't work
 cboxHour.Text = "";

and

//doesn't work
cboxHour.ResetText();

This seems like it should be so straight forward but I'm just not getting it.

解决方案

Did you try cboxHour.Items.Clear()?

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

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