双击commmand1对象进入该对象的代码区域,选择对象为commmand1,过程选择click,然后输入代码:

Dim a As Single

Dim b As Single

Dim c As Single

Dim d As Single

Dim e As Single

Dim f As Single

If (Text1.Text > 0) And (Text2.Text > 0) Then

a = Text2.Text * Text4.Text

b = Text5.Text * Text1.Text

c = a - b

d = Text3.Text * Text4.Text - Text6.Text * Text1.Text

e = d / c

f = (Text3.Text - Text2.Text * e) / Text1.Text

Text7.Text = f

Text8.Text = e

End If

If ((Text1.Text > 0) And (Text2.Text < 0)) Or ((Text1.Text < 0) And (Text2.Text > 0)) Then

a = Text2.Text * Text4.Text

b = Text5.Text * Text1.Text

c = a + b

d = Text3.Text * Text4.Text - Text6.Text * Text1.Text

e = d / c

f = (Text3.Text - Text2.Text * e) / Text1.Text

Text7.Text = f

Text8.Text = e

End If

Logo

GitCode AI社区是一款由 GitCode 团队打造的智能助手,AI大模型社区、提供国内外头部大模型及数据集服务。

更多推荐