需要帮助Select Case [英] Need help with Select Case

查看:74
本文介绍了需要帮助Select Case的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是VB express 2005的新手,我在编码方面遇到了一些麻烦。


我在我的程序中使用了CASE结构,我想知道是否任何人都可以帮助我。而不是说案例1,2,3,4而不是有没有办法说1到4。我已经尝试了一切,没有任何作用。

(TextBox1.Text> = 1)和(TextBox1.Text< = 4)也没有用。


PS:实际问题比1,2,3,4更复杂


谢谢大家,希望你能帮忙。

展开 | 选择 | Wrap | 行号

解决方案


我是新来的VB表达2005并且在编码方面遇到了一些麻烦。


我在我的程序中使用CASE结构而且我很想念如果有人可以帮助我的话。而不是说案例1,2,3,4而不是有没有办法说1到4。我已经尝试了一切,没有任何作用。

(TextBox1.Text> = 1)和(TextBox1.Text< = 4)也没有用。


PS:实际问题比1,2,3,4更复杂


谢谢大家,希望你能帮忙。


选择案例TextBox1.Text

案例1,2,3,4

生成器(TextBox1.Text)

退出选择

Case Else

MsgBox(请输入介于1到150之间的数值。,vbOKOnly,Generate_1)

TextBox1.Clear()

TextBox1.Focus()

退出选择

结束选择



如果条件更好,你可以使用。

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


在VB6中,您会说案例1到4 。但是,不知道你的版本。您尝试过什么?



在VB6中,您会说案例1到4 。但是,不知道你的版本。你有什么尝试?



我从未尝试过任何事情。刚建议他使用?如果?条件


I''m new to VB express 2005 and am having some trouble with coding.

I''m using a CASE structure in my program and i''m wondering if anyone can help me. Instead of Saying "Case 1,2,3,4" is there a way of saying "1 to 4". I''ve tried everything and nothing works.
(TextBox1.Text >= 1) And (TextBox1.Text <= 4) didn''t work either.

PS: the actual problem is a bit more complex than just 1,2,3,4

Thanks guys, hope you can help.

Expand|Select|Wrap|Line Numbers

解决方案

I''m new to VB express 2005 and am having some trouble with coding.

I''m using a CASE structure in my program and i''m wondering if anyone can help me. Instead of Saying "Case 1,2,3,4" is there a way of saying "1 to 4". I''ve tried everything and nothing works.
(TextBox1.Text >= 1) And (TextBox1.Text <= 4) didn''t work either.

PS: the actual problem is a bit more complex than just 1,2,3,4

Thanks guys, hope you can help.

Select Case TextBox1.Text
Case 1, 2, 3, 4
Generator(TextBox1.Text)
Exit Select
Case Else
MsgBox("Please enter numeric values between 1 to 150.", vbOKOnly, "Generate_1")
TextBox1.Clear()
TextBox1.Focus()
Exit Select
End Select

better you can use if condition.

Expand|Select|Wrap|Line Numbers


In VB6, you would say Case 1 To 4. Don''t know about your version, though. What have you tried?


In VB6, you would say Case 1 To 4. Don''t know about your version, though. What have you tried?


I never tried any thing. Just suggested him to use ?if? condition


这篇关于需要帮助Select Case的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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