如果组合框没有选择则文本框值为0 [英] if combobox not select then textbox value is 0

查看:85
本文介绍了如果组合框没有选择则文本框值为0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从月份到月份到月份的金额

textbox combobox1 combobox2 combobox3 combobox4



如果我还没有选择所有四个组合框然后文本框值自动显示0提交按钮

Amount From Month From Year To Month To year
textbox combobox1 combobox2 combobox3 combobox4

if i have not select all four combobox then textbox value show automatically 0 on submit button

推荐答案

在提交按钮单击事件中检查combox选择的索引或所选项目值或文本属性。如果所有4个值都没有任何值,则可以将文本框值视为零。

您要测试的字段取决于您如何绑定每个组合框,是否有任何默认值等。

检查以下文档

ComboBox.SelectedIndex Property [ ^ ]

ComboBox.SelectedItem属性 [ ^ ]

ListControl.SelectedValue Property [ ^ ]

ListControl.SelectedValue属性 [ ^ ]
in your submit button click event check the combox selected index or selected item value or Text properties. if all 4 values not having any value you can consider textbox value as zero.
the field you going to test is depend on how you binding each combo box, is there any default value etc..
check below documentations
ComboBox.SelectedIndex Property[^]
ComboBox.SelectedItem Property[^]
ListControl.SelectedValue Property[^]
ListControl.SelectedValue Property[^]


这篇关于如果组合框没有选择则文本框值为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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