在2个组合框中选择唯一的项目.... [英] Selecting unique items in 2 comboboxes....

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

问题描述

两个组合框同时具有项目1和2.如果在一个组合框中选择了一个,则必须在另一个组合中选择2.如果我们尝试在第二个组合框中再次选择一个,则应该显示消息框1已被选中.请告诉我如何编写逻辑.

two combobox are there both have items 1 and 2.if one is selected in one combobox then 2 must be selected in other.if we try to select one again in second combobox it should show messang 1 is alrady selected.please tell me how to write the logic.

推荐答案

个人?我将为第一个ComboBox处理SelectedValueChanged事件,并在第二个ComboBox中设置适当的值,然后禁用第二个,以便用户无法更改它.首先防止用户犯错误,而不是事后告诉他,这对用户更友好.
Personally? I would handle the SelectedValueChanged event for the first ComboBox and set the appropriate value in the second, then disable the second so the user could not change it. It''s much more user friendly to prevent the user making mistakes in the first place, than to tell him off afterwards.


这篇关于在2个组合框中选择唯一的项目....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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