Private Sub Command1_Click()
  Dim i As Single, j As Single, k As Single
  Dim x1 As Single, x2 As Single
  i = Text1.Text
  j = Text2.Text
  k = Text3.Text
  asd i, j, k, x1, x2
  Label6.Caption = x1
  Label7.Caption = x2
End SubSub asd(ByVal a As Single, ByVal b As Single, ByVal c As Single, x As Single, y As Single)
   If b * b - 4 * a * c < 0 Then
      Exit Sub
   Else
   x = (-b + Sqr(b * b - 4 * a * c)) / (2 * a)
   y = (-b - Sqr(b * b - 4 * a * c)) / (2 * a)
   End If
End Sub

解决方案 »

  1.   

    我帮你,应该这样:
    Private Sub Command1_Click()
      Dim i, j, k As Single
      Dim x1, x2 As Single
      i = Val(Text1.Text)
      j = Val(Text2.Text)
      k = Val(Text3.Text)
      asd i, j, k, x1, x2
      Label6.Caption = x1
      Label7.Caption = x2
    End SubSub asd(ByVal a As Single, ByVal b As Single, ByVal c As Single, ByVal x As Single, ByVal y As Single)
       If b * b - 4 * a * c < 0 Then
          'End Sub
          Exit Sub
       Else
       x = (-b + Sqr(b * b - 4 * a * c)) / (2 * a)
       y = (-b - Sqr(b * b - 4 * a * c)) / (2 * a)
       End If
       
    End Sub
      

  2.   

    多谢两位.hequnmin(Min):我要把x,y的值带出来,byval不能实现.hycao(海草) :多谢了,加分.