假设命令按钮为commandbutton1
单选按钮option1(0) 为Sqr
option1(1)为Exp
写以下程序
Private Sub Command1_Click()
If Option1(0).Value Then
Text2.Text = Sqr(Val(Text1.Text))
Else
Text2.Text = Exp(Val(Text1.Text))
End If
End Sub
dim a as integer
a = Cint(textBox1.Text)
dim d
if radiobutton1.checked=true then
d = sqrt(a)
elseif radiobutton2.checked=true
d = Exp(a)
end if
textbox2.text = d