如何检查是否在组合框中选定项或不是在C#? [英] how to check whether the item in the combo box is selected or not in c#?

查看:125
本文介绍了如何检查是否在组合框中选定项或不是在C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯有一个组合框在我所要显示的日期从数据库......用户必须选择从组合框中选择一个日期,以进一步进行...但林不能够让用户知道,从选择项目组合框第一次进一步进行...怎样的程序,这样,如果他没有选择从组合之日起,用户可以得到一个消息。

解决方案

 如果(string.IsNullOrEmpty(ComboBox.SelectedText))
{
 的MessageBox.show(选择日期);
}
 

im having a combo box in which i have to display dates from database...user have to select a date from the combo box to proceed further...but im not able to make the user aware of selecting the item from the combo box first to proceed further...what is the process so that a user can get a message if he has not selected the date from the combo..

解决方案

if (string.IsNullOrEmpty(ComboBox.SelectedText)) 
{
 MessageBox.Show("Select a date");
}

这篇关于如何检查是否在组合框中选定项或不是在C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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