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