永发信息网

vb编程的问题,哪个会的人指点下。关于多条件同时运行的。

答案:2  悬赏:60  手机版
解决时间 2021-05-06 03:31
  • 提问者网友:蔚蓝的太阳
  • 2021-05-05 15:37

我想在左边选择后在右边相应的显示结果要可以随意选择多个的,那个高手看下。谢啦!我做的程序如下:

Private Sub Command1_Click()
Dim a As Single, y1 As Single, y2 As Single, y3 As Single, y4 As Single, y5 As Single, y6 As Single
Dim x1 As Single, x2 As Single
Dim x3 As Single, x5 As Single
a = Val(Text1.Text)
x1 = 0.0225: x2 = 0.027: x3 = 0.0324: x5 = 0.036
Select Case True
Case Check1.Value
y1 = (1 + 3 * x3) * a
Case Check2.Value
y2 = (1 + 3 * x3) * (1 + 2 * x2) * a
Case Check3.Value
y3 = (1 + 3 * x3) * a * (1 + x1) ^ 2
Case Check4.Value
y4 = (1 + 2 + 2 * x2) ^ 2 * a * (1 + x1)
Case Check5.Value
y5 = (1 + 2 * x2) * (1 + x1) ^ 3 * a
Case Check6.Value
y6 = (1 + x1) ^ 5 * a
End Select
Text2.Text = y1: Text3.Text = y2: Text4.Text = y3:
Text5.Text = y4: Text6.Text = y5: Text7.Text = y6
Text1.SetFocus
End Sub

Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)

End Sub

最佳答案
  • 五星知识达人网友:忘川信使
  • 2021-05-05 16:20
看不到图片
全部回答
  • 1楼网友:蓝房子
  • 2021-05-05 17:42
确实看不到图片呀
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯