在窗口上新建一个按钮,代码如下:
PrivateSubCommand1_Click()
DimaAsSingle
DimbAsSingle
DimcAsSingle
DimxAsSingle
DimyAsSingle
a=Val(InputBox("请输入a","参数a"))
b=Val(InputBox("请输入b","参数b"))
c=Val(InputBox("请输入c","参数c"))
x=Val(InputBox("请输入x","参数x"))
y=a*x^2+b*x+c
Print"y="&a&"*"&x&"^2+"&b&"*"&x&"+"&c&"="&y
EndSub