内容简介:翻译自:https://stackoverflow.com/questions/13970603/multiple-select-cases-in-vb-net
我试过以下:
Select Case Combo1.SelectedItem Or Combo2.SelectedItem
但我得到错误:
Conversion from String "string here" to type 'Long' is not valid
是否可以有多个选择案例?
您可以使用逗号分隔多个值:
Case Combo1.SelectedItem, Combo2.SelectedItem
使用Or会使它成为一个表达式,在与Select中的值进行比较之前进行评估.
如果Select中的值是Long值,那么您可能需要转换控件中的字符串:
Case CLng(Combo1.SelectedItem), CLng(Combo2.SelectedItem)
要直接解决问题,不可能在select中使用多个值作为测试表达式:
Select Case v1, v2 'Not possible
翻译自:https://stackoverflow.com/questions/13970603/multiple-select-cases-in-vb-net
以上所述就是小编给大家介绍的《VB.NET中的多个选择案例》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Uberland
Alex Rosenblat / University of California Press / 2018-11-19 / GBP 21.00
Silicon Valley technology is transforming the way we work, and Uber is leading the charge. An American startup that promised to deliver entrepreneurship for the masses through its technology, Uber ins......一起来看看 《Uberland》 这本书的介绍吧!