且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果组合框没有选择则文本框值为0

更新时间:2023-02-21 23:17:08

在提交按钮单击事件中检查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[^]